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