@herb-tools/formatter 0.8.6 → 0.8.7
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-format.js +19622 -31462
- package/dist/herb-format.js.map +1 -1
- package/dist/index.cjs +16 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +16 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -5
- package/src/cli.ts +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -64,6 +64,18 @@ function createDedent(options) {
|
|
|
64
64
|
if (escapeSpecialCharacters) {
|
|
65
65
|
result = result.replace(/\\n/g, "\n");
|
|
66
66
|
}
|
|
67
|
+
|
|
68
|
+
// Workaround for Bun issue with Unicode characters
|
|
69
|
+
// https://github.com/oven-sh/bun/issues/8745
|
|
70
|
+
if (typeof Bun !== "undefined") {
|
|
71
|
+
result = result.replace(
|
|
72
|
+
// Matches e.g. \\u{1f60a} or \\u5F1F
|
|
73
|
+
/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (_, braced, unbraced) => {
|
|
74
|
+
var _ref;
|
|
75
|
+
const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : "";
|
|
76
|
+
return String.fromCodePoint(parseInt(hex, 16));
|
|
77
|
+
});
|
|
78
|
+
}
|
|
67
79
|
return result;
|
|
68
80
|
}
|
|
69
81
|
}
|
|
@@ -241,7 +253,7 @@ class Token {
|
|
|
241
253
|
}
|
|
242
254
|
|
|
243
255
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
244
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
256
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.7/templates/javascript/packages/core/src/errors.ts.erb
|
|
245
257
|
class HerbError {
|
|
246
258
|
type;
|
|
247
259
|
message;
|
|
@@ -806,7 +818,7 @@ function convertToUTF8(string) {
|
|
|
806
818
|
}
|
|
807
819
|
|
|
808
820
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
809
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
821
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.7/templates/javascript/packages/core/src/nodes.ts.erb
|
|
810
822
|
class Node {
|
|
811
823
|
type;
|
|
812
824
|
location;
|
|
@@ -3040,7 +3052,7 @@ class ParseResult extends Result {
|
|
|
3040
3052
|
}
|
|
3041
3053
|
|
|
3042
3054
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3043
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3055
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.7/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
3044
3056
|
/**
|
|
3045
3057
|
* Type guard functions for AST nodes.
|
|
3046
3058
|
* These functions provide type checking by combining both instanceof
|
|
@@ -3537,7 +3549,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
|
|
|
3537
3549
|
}
|
|
3538
3550
|
|
|
3539
3551
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3540
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3552
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.7/templates/javascript/packages/core/src/visitor.ts.erb
|
|
3541
3553
|
class Visitor {
|
|
3542
3554
|
visit(node) {
|
|
3543
3555
|
if (!node)
|