@herb-tools/core 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/herb-core.browser.js +17 -7
- package/dist/herb-core.browser.js.map +1 -1
- package/dist/herb-core.cjs +17 -6
- package/dist/herb-core.cjs.map +1 -1
- package/dist/herb-core.esm.js +17 -7
- package/dist/herb-core.esm.js.map +1 -1
- package/dist/herb-core.umd.js +17 -6
- package/dist/herb-core.umd.js.map +1 -1
- package/dist/types/ast-utils.d.ts +11 -2
- package/package.json +1 -1
- package/src/ast-utils.ts +20 -3
- package/src/errors.ts +1 -1
- package/src/node-type-guards.ts +1 -1
- package/src/nodes.ts +1 -1
- package/src/visitor.ts +1 -1
|
@@ -155,7 +155,7 @@ class Token {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
158
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
158
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/errors.ts.erb
|
|
159
159
|
class HerbError {
|
|
160
160
|
type;
|
|
161
161
|
message;
|
|
@@ -692,7 +692,7 @@ function convertToUTF8(string) {
|
|
|
692
692
|
}
|
|
693
693
|
|
|
694
694
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
695
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
695
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/nodes.ts.erb
|
|
696
696
|
class Node {
|
|
697
697
|
type;
|
|
698
698
|
location;
|
|
@@ -2945,7 +2945,7 @@ class ParseResult extends Result {
|
|
|
2945
2945
|
}
|
|
2946
2946
|
|
|
2947
2947
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2948
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2948
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
2949
2949
|
/**
|
|
2950
2950
|
* Type guard functions for AST nodes.
|
|
2951
2951
|
* These functions provide type checking by combining both instanceof
|
|
@@ -3572,6 +3572,16 @@ function isERBOutputNode(node) {
|
|
|
3572
3572
|
return false;
|
|
3573
3573
|
return ["<%=", "<%=="].includes(node.tag_opening?.value);
|
|
3574
3574
|
}
|
|
3575
|
+
/**
|
|
3576
|
+
* Checks if a node is a ERB comment node (control flow: <%# %>)
|
|
3577
|
+
*/
|
|
3578
|
+
function isERBCommentNode(node) {
|
|
3579
|
+
if (!isERBNode(node))
|
|
3580
|
+
return false;
|
|
3581
|
+
if (!node.tag_opening?.value)
|
|
3582
|
+
return false;
|
|
3583
|
+
return node.tag_opening?.value === "<%#" || (node.tag_opening?.value !== "<%#" && (node.content?.value || "").trimStart().startsWith("#"));
|
|
3584
|
+
}
|
|
3575
3585
|
/**
|
|
3576
3586
|
* Checks if a node is a non-output ERB node (control flow: <% %>)
|
|
3577
3587
|
*/
|
|
@@ -3704,7 +3714,7 @@ function getTagName(node) {
|
|
|
3704
3714
|
* Check if a node is a comment (HTML comment or ERB comment)
|
|
3705
3715
|
*/
|
|
3706
3716
|
function isCommentNode(node) {
|
|
3707
|
-
return
|
|
3717
|
+
return isHTMLCommentNode(node) || isERBCommentNode(node);
|
|
3708
3718
|
}
|
|
3709
3719
|
/**
|
|
3710
3720
|
* Compares two positions to determine if the first comes before the second
|
|
@@ -4015,7 +4025,7 @@ function didyoumeanRanked(input, list, threshold) {
|
|
|
4015
4025
|
}
|
|
4016
4026
|
|
|
4017
4027
|
var name = "@herb-tools/core";
|
|
4018
|
-
var version = "0.8.
|
|
4028
|
+
var version = "0.8.3";
|
|
4019
4029
|
var packageJSON = {
|
|
4020
4030
|
name: name,
|
|
4021
4031
|
version: version};
|
|
@@ -4238,7 +4248,7 @@ class HerbBackend {
|
|
|
4238
4248
|
}
|
|
4239
4249
|
|
|
4240
4250
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4241
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4251
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4242
4252
|
class Visitor {
|
|
4243
4253
|
visit(node) {
|
|
4244
4254
|
if (!node)
|
|
@@ -4400,5 +4410,5 @@ class Visitor {
|
|
|
4400
4410
|
}
|
|
4401
4411
|
}
|
|
4402
4412
|
|
|
4403
|
-
export { AST_TYPE_GUARDS, CDATANode, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, ERBNodeClasses, ERBRescueNode, ERBUnlessNode, ERBUntilNode, ERBWhenNode, ERBWhileNode, ERBYieldNode, HTMLAttributeNameNode, HTMLAttributeNode, HTMLAttributeValueNode, HTMLCloseTagNode, HTMLCommentNode, HTMLDoctypeNode, HTMLElementNode, HTMLOpenTagNode, HTMLTextNode, HerbBackend, HerbError, HerbWarning, LexResult, LiteralNode, Location, MissingClosingTagError, MissingERBEndTagError, MissingOpeningTagError, NODE_TYPE_GUARDS, Node, ParseResult, Position, QuotesMismatchError, Range, Result, RubyParseError, TagNamesMismatchError, Token, TokenList, UnclosedElementError, UnexpectedError, UnexpectedTokenError, Visitor, VoidElementClosingTagError, WhitespaceNode, XMLDeclarationNode, _TYPECHECK, areAllOfType, convertToUTF8, didyoumean, didyoumeanRanked, ensureLibHerbBackend, ensureString, filterCDATANodes, filterDocumentNodes, filterERBBeginNodes, filterERBBlockNodes, filterERBCaseMatchNodes, filterERBCaseNodes, filterERBContentNodes, filterERBElseNodes, filterERBEndNodes, filterERBEnsureNodes, filterERBForNodes, filterERBIfNodes, filterERBInNodes, filterERBRescueNodes, filterERBUnlessNodes, filterERBUntilNodes, filterERBWhenNodes, filterERBWhileNodes, filterERBYieldNodes, filterHTMLAttributeNameNodes, filterHTMLAttributeNodes, filterHTMLAttributeValueNodes, filterHTMLCloseTagNodes, filterHTMLCommentNodes, filterHTMLDoctypeNodes, filterHTMLElementNodes, filterHTMLOpenTagNodes, filterHTMLTextNodes, filterLiteralNodes, filterNodes, filterWhitespaceNodes, filterXMLDeclarationNodes, fromSerializedError, fromSerializedNode, getCombinedAttributeName, getCombinedStringFromNodes, getNodesAfterLocation, getNodesAfterPosition, getNodesBeforeLocation, getNodesBeforePosition, getStaticAttributeName, getStaticContentFromNodes, getStaticStringFromNodes, getTagName, getValidatableStaticContent, hasChildren, hasDynamicAttributeName, hasERBContent, hasERBOutput, hasStaticAttributeName, hasStaticContent, isAnyOf, isCDATANode, isCommentNode, isDocumentNode, isERBBeginNode, isERBBlockNode, isERBCaseMatchNode, isERBCaseNode, isERBContentNode, isERBControlFlowNode, isERBElseNode, isERBEndNode, isERBEnsureNode, isERBForNode, isERBIfNode, isERBInNode, isERBNode, isERBOutputNode, isERBRescueNode, isERBUnlessNode, isERBUntilNode, isERBWhenNode, isERBWhileNode, isERBYieldNode, isEffectivelyStatic, isHTMLAttributeNameNode, isHTMLAttributeNode, isHTMLAttributeValueNode, isHTMLCloseTagNode, isHTMLCommentNode, isHTMLDoctypeNode, isHTMLElementNode, isHTMLNode, isHTMLOpenTagNode, isHTMLTextNode, isLibHerbBackend, isLiteralNode, isNode, isNoneOf, isParseResult, isPositionAfter, isPositionEqual, isToken, isWhitespaceNode, isXMLDeclarationNode, levenshtein, splitNodesAroundLocation, splitNodesAroundPosition, toMonacoDiagnostic };
|
|
4413
|
+
export { AST_TYPE_GUARDS, CDATANode, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, ERBNodeClasses, ERBRescueNode, ERBUnlessNode, ERBUntilNode, ERBWhenNode, ERBWhileNode, ERBYieldNode, HTMLAttributeNameNode, HTMLAttributeNode, HTMLAttributeValueNode, HTMLCloseTagNode, HTMLCommentNode, HTMLDoctypeNode, HTMLElementNode, HTMLOpenTagNode, HTMLTextNode, HerbBackend, HerbError, HerbWarning, LexResult, LiteralNode, Location, MissingClosingTagError, MissingERBEndTagError, MissingOpeningTagError, NODE_TYPE_GUARDS, Node, ParseResult, Position, QuotesMismatchError, Range, Result, RubyParseError, TagNamesMismatchError, Token, TokenList, UnclosedElementError, UnexpectedError, UnexpectedTokenError, Visitor, VoidElementClosingTagError, WhitespaceNode, XMLDeclarationNode, _TYPECHECK, areAllOfType, convertToUTF8, didyoumean, didyoumeanRanked, ensureLibHerbBackend, ensureString, filterCDATANodes, filterDocumentNodes, filterERBBeginNodes, filterERBBlockNodes, filterERBCaseMatchNodes, filterERBCaseNodes, filterERBContentNodes, filterERBElseNodes, filterERBEndNodes, filterERBEnsureNodes, filterERBForNodes, filterERBIfNodes, filterERBInNodes, filterERBRescueNodes, filterERBUnlessNodes, filterERBUntilNodes, filterERBWhenNodes, filterERBWhileNodes, filterERBYieldNodes, filterHTMLAttributeNameNodes, filterHTMLAttributeNodes, filterHTMLAttributeValueNodes, filterHTMLCloseTagNodes, filterHTMLCommentNodes, filterHTMLDoctypeNodes, filterHTMLElementNodes, filterHTMLOpenTagNodes, filterHTMLTextNodes, filterLiteralNodes, filterNodes, filterWhitespaceNodes, filterXMLDeclarationNodes, fromSerializedError, fromSerializedNode, getCombinedAttributeName, getCombinedStringFromNodes, getNodesAfterLocation, getNodesAfterPosition, getNodesBeforeLocation, getNodesBeforePosition, getStaticAttributeName, getStaticContentFromNodes, getStaticStringFromNodes, getTagName, getValidatableStaticContent, hasChildren, hasDynamicAttributeName, hasERBContent, hasERBOutput, hasStaticAttributeName, hasStaticContent, isAnyOf, isCDATANode, isCommentNode, isDocumentNode, isERBBeginNode, isERBBlockNode, isERBCaseMatchNode, isERBCaseNode, isERBCommentNode, isERBContentNode, isERBControlFlowNode, isERBElseNode, isERBEndNode, isERBEnsureNode, isERBForNode, isERBIfNode, isERBInNode, isERBNode, isERBOutputNode, isERBRescueNode, isERBUnlessNode, isERBUntilNode, isERBWhenNode, isERBWhileNode, isERBYieldNode, isEffectivelyStatic, isHTMLAttributeNameNode, isHTMLAttributeNode, isHTMLAttributeValueNode, isHTMLCloseTagNode, isHTMLCommentNode, isHTMLDoctypeNode, isHTMLElementNode, isHTMLNode, isHTMLOpenTagNode, isHTMLTextNode, isLibHerbBackend, isLiteralNode, isNode, isNoneOf, isParseResult, isPositionAfter, isPositionEqual, isToken, isWhitespaceNode, isXMLDeclarationNode, levenshtein, splitNodesAroundLocation, splitNodesAroundPosition, toMonacoDiagnostic };
|
|
4404
4414
|
//# sourceMappingURL=herb-core.browser.js.map
|