@mintjamsinc/ichigojs 0.1.47 → 0.1.48

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/ichigo.cjs CHANGED
@@ -8621,8 +8621,10 @@
8621
8621
  * @param functionDependencies A dictionary mapping function names to their dependencies.
8622
8622
  */
8623
8623
  constructor(text, functionDependencies) {
8624
- // Extract expressions in {{...}} using regex
8625
- const regex = /\{\{([^}]+)\}\}/g;
8624
+ // Extract expressions in {{...}} using regex.
8625
+ // Allow `}` inside the expression as long as it is not followed by another `}`,
8626
+ // so that object literals like `{ short: true }` are captured correctly.
8627
+ const regex = /\{\{((?:[^}]|\}(?!\}))+)\}\}/g;
8626
8628
  const matches = Array.from(text.matchAll(regex));
8627
8629
  // Gather identifiers from the extracted expressions
8628
8630
  this.#identifiers = [];
@@ -8678,7 +8680,7 @@
8678
8680
  * @returns True if the text contains expressions, false otherwise.
8679
8681
  */
8680
8682
  static containsExpression(text) {
8681
- const regex = /\{\{([^}]+)\}\}/g;
8683
+ const regex = /\{\{((?:[^}]|\}(?!\}))+)\}\}/g;
8682
8684
  return regex.test(text);
8683
8685
  }
8684
8686
  /**