@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
package/dist/herb-core.cjs
CHANGED
|
@@ -157,7 +157,7 @@ class Token {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
160
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
160
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/errors.ts.erb
|
|
161
161
|
class HerbError {
|
|
162
162
|
type;
|
|
163
163
|
message;
|
|
@@ -694,7 +694,7 @@ function convertToUTF8(string) {
|
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
697
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
697
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/nodes.ts.erb
|
|
698
698
|
class Node {
|
|
699
699
|
type;
|
|
700
700
|
location;
|
|
@@ -2947,7 +2947,7 @@ class ParseResult extends Result {
|
|
|
2947
2947
|
}
|
|
2948
2948
|
|
|
2949
2949
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2950
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2950
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
2951
2951
|
/**
|
|
2952
2952
|
* Type guard functions for AST nodes.
|
|
2953
2953
|
* These functions provide type checking by combining both instanceof
|
|
@@ -3574,6 +3574,16 @@ function isERBOutputNode(node) {
|
|
|
3574
3574
|
return false;
|
|
3575
3575
|
return ["<%=", "<%=="].includes(node.tag_opening?.value);
|
|
3576
3576
|
}
|
|
3577
|
+
/**
|
|
3578
|
+
* Checks if a node is a ERB comment node (control flow: <%# %>)
|
|
3579
|
+
*/
|
|
3580
|
+
function isERBCommentNode(node) {
|
|
3581
|
+
if (!isERBNode(node))
|
|
3582
|
+
return false;
|
|
3583
|
+
if (!node.tag_opening?.value)
|
|
3584
|
+
return false;
|
|
3585
|
+
return node.tag_opening?.value === "<%#" || (node.tag_opening?.value !== "<%#" && (node.content?.value || "").trimStart().startsWith("#"));
|
|
3586
|
+
}
|
|
3577
3587
|
/**
|
|
3578
3588
|
* Checks if a node is a non-output ERB node (control flow: <% %>)
|
|
3579
3589
|
*/
|
|
@@ -3706,7 +3716,7 @@ function getTagName(node) {
|
|
|
3706
3716
|
* Check if a node is a comment (HTML comment or ERB comment)
|
|
3707
3717
|
*/
|
|
3708
3718
|
function isCommentNode(node) {
|
|
3709
|
-
return
|
|
3719
|
+
return isHTMLCommentNode(node) || isERBCommentNode(node);
|
|
3710
3720
|
}
|
|
3711
3721
|
/**
|
|
3712
3722
|
* Compares two positions to determine if the first comes before the second
|
|
@@ -4017,7 +4027,7 @@ function didyoumeanRanked(input, list, threshold) {
|
|
|
4017
4027
|
}
|
|
4018
4028
|
|
|
4019
4029
|
var name = "@herb-tools/core";
|
|
4020
|
-
var version = "0.8.
|
|
4030
|
+
var version = "0.8.3";
|
|
4021
4031
|
var packageJSON = {
|
|
4022
4032
|
name: name,
|
|
4023
4033
|
version: version};
|
|
@@ -4240,7 +4250,7 @@ class HerbBackend {
|
|
|
4240
4250
|
}
|
|
4241
4251
|
|
|
4242
4252
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4243
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4253
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4244
4254
|
class Visitor {
|
|
4245
4255
|
visit(node) {
|
|
4246
4256
|
if (!node)
|
|
@@ -4527,6 +4537,7 @@ exports.isERBBeginNode = isERBBeginNode;
|
|
|
4527
4537
|
exports.isERBBlockNode = isERBBlockNode;
|
|
4528
4538
|
exports.isERBCaseMatchNode = isERBCaseMatchNode;
|
|
4529
4539
|
exports.isERBCaseNode = isERBCaseNode;
|
|
4540
|
+
exports.isERBCommentNode = isERBCommentNode;
|
|
4530
4541
|
exports.isERBContentNode = isERBContentNode;
|
|
4531
4542
|
exports.isERBControlFlowNode = isERBControlFlowNode;
|
|
4532
4543
|
exports.isERBElseNode = isERBElseNode;
|