@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.umd.js
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
164
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
164
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/errors.ts.erb
|
|
165
165
|
class HerbError {
|
|
166
166
|
type;
|
|
167
167
|
message;
|
|
@@ -698,7 +698,7 @@
|
|
|
698
698
|
}
|
|
699
699
|
|
|
700
700
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
701
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
701
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/nodes.ts.erb
|
|
702
702
|
class Node {
|
|
703
703
|
type;
|
|
704
704
|
location;
|
|
@@ -2951,7 +2951,7 @@
|
|
|
2951
2951
|
}
|
|
2952
2952
|
|
|
2953
2953
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2954
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2954
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
2955
2955
|
/**
|
|
2956
2956
|
* Type guard functions for AST nodes.
|
|
2957
2957
|
* These functions provide type checking by combining both instanceof
|
|
@@ -3578,6 +3578,16 @@
|
|
|
3578
3578
|
return false;
|
|
3579
3579
|
return ["<%=", "<%=="].includes(node.tag_opening?.value);
|
|
3580
3580
|
}
|
|
3581
|
+
/**
|
|
3582
|
+
* Checks if a node is a ERB comment node (control flow: <%# %>)
|
|
3583
|
+
*/
|
|
3584
|
+
function isERBCommentNode(node) {
|
|
3585
|
+
if (!isERBNode(node))
|
|
3586
|
+
return false;
|
|
3587
|
+
if (!node.tag_opening?.value)
|
|
3588
|
+
return false;
|
|
3589
|
+
return node.tag_opening?.value === "<%#" || (node.tag_opening?.value !== "<%#" && (node.content?.value || "").trimStart().startsWith("#"));
|
|
3590
|
+
}
|
|
3581
3591
|
/**
|
|
3582
3592
|
* Checks if a node is a non-output ERB node (control flow: <% %>)
|
|
3583
3593
|
*/
|
|
@@ -3710,7 +3720,7 @@
|
|
|
3710
3720
|
* Check if a node is a comment (HTML comment or ERB comment)
|
|
3711
3721
|
*/
|
|
3712
3722
|
function isCommentNode(node) {
|
|
3713
|
-
return
|
|
3723
|
+
return isHTMLCommentNode(node) || isERBCommentNode(node);
|
|
3714
3724
|
}
|
|
3715
3725
|
/**
|
|
3716
3726
|
* Compares two positions to determine if the first comes before the second
|
|
@@ -4021,7 +4031,7 @@
|
|
|
4021
4031
|
}
|
|
4022
4032
|
|
|
4023
4033
|
var name = "@herb-tools/core";
|
|
4024
|
-
var version = "0.8.
|
|
4034
|
+
var version = "0.8.3";
|
|
4025
4035
|
var packageJSON = {
|
|
4026
4036
|
name: name,
|
|
4027
4037
|
version: version};
|
|
@@ -4244,7 +4254,7 @@
|
|
|
4244
4254
|
}
|
|
4245
4255
|
|
|
4246
4256
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
4247
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
4257
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.3/templates/javascript/packages/core/src/visitor.ts.erb
|
|
4248
4258
|
class Visitor {
|
|
4249
4259
|
visit(node) {
|
|
4250
4260
|
if (!node)
|
|
@@ -4531,6 +4541,7 @@
|
|
|
4531
4541
|
exports.isERBBlockNode = isERBBlockNode;
|
|
4532
4542
|
exports.isERBCaseMatchNode = isERBCaseMatchNode;
|
|
4533
4543
|
exports.isERBCaseNode = isERBCaseNode;
|
|
4544
|
+
exports.isERBCommentNode = isERBCommentNode;
|
|
4534
4545
|
exports.isERBContentNode = isERBContentNode;
|
|
4535
4546
|
exports.isERBControlFlowNode = isERBControlFlowNode;
|
|
4536
4547
|
exports.isERBElseNode = isERBElseNode;
|