@truto/truto-jsonata 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -1459,6 +1459,43 @@ This is a **bold** statement.
1459
1459
 
1460
1460
  </details>
1461
1461
 
1462
+ <details>
1463
+ <summary>convertMarkdownToHtml(markdownString)</summary>
1464
+
1465
+ Converts Markdown content to HTML format.
1466
+
1467
+ **Example:**
1468
+
1469
+ ```javascript
1470
+ import trutoJsonata from '@truto/truto-jsonata';
1471
+
1472
+ // Define an Markdown string to convert
1473
+ const markdownContent = `
1474
+ # Welcome to Markdown
1475
+ This is a **bold** statement.
1476
+ - Item 1
1477
+ - Item 2
1478
+ `;
1479
+
1480
+ // Use convertMarkdownToHtml to transform Markdown into HTML
1481
+ const expression = trutoJsonata("$convertMarkdownToHtml(markdownContent)");
1482
+ expression.evaluate({ markdownContent }).then(result => { console.log(result); });
1483
+
1484
+ /*
1485
+ Output:
1486
+
1487
+ <h1>Welcome to Markdown</h1>
1488
+ <p>This is a <strong>bold</strong> statement.</p>
1489
+ <ul>
1490
+ <li>Item 1</li>
1491
+ <li>Item 2</li>
1492
+ </ul>
1493
+
1494
+ */
1495
+ ```
1496
+
1497
+ </details>
1498
+
1462
1499
  ---
1463
1500
 
1464
1501
  ### Array and Object Utilities (Lodash Enhancements)
package/dist/main.cjs CHANGED
@@ -6,7 +6,6 @@ var $dxT2C$dicecoefficient = require("dice-coefficient");
6
6
  var $dxT2C$mixmarkiodomino = require("@mixmark-io/domino");
7
7
  var $dxT2C$turndown = require("turndown");
8
8
  var $dxT2C$turndownplugingfm = require("turndown-plugin-gfm");
9
- var $dxT2C$crypto = require("crypto");
10
9
  var $dxT2C$xmljs = require("xml-js");
11
10
  var $dxT2C$json2md = require("json2md");
12
11
  var $dxT2C$mime = require("mime");
@@ -862,11 +861,10 @@ function $c9ed3be7896125da$export$2e2bcd8739ae039(buffer, urlSafe = false) {
862
861
  }
863
862
 
864
863
 
865
-
866
864
  const $1cf667e257c1904d$var$digest = async (text, algorithm = "SHA-256", stringType = "hex")=>{
867
865
  const encoder = new TextEncoder();
868
866
  const data = encoder.encode(text);
869
- const hashBuffer = await (0, $dxT2C$crypto.webcrypto).subtle.digest(algorithm, data);
867
+ const hashBuffer = await crypto.subtle.digest(algorithm, data);
870
868
  if (stringType === "hex") {
871
869
  const hashArray = Array.from(new Uint8Array(hashBuffer));
872
870
  return hashArray.map((b)=>b.toString(16).padStart(2, "0")).join("");
@@ -1020,9 +1018,8 @@ var $6c8155c4308ceae8$export$2e2bcd8739ae039 = $6c8155c4308ceae8$var$convertNoti
1020
1018
 
1021
1019
 
1022
1020
 
1023
-
1024
1021
  const $256af523deaf5315$var$sign = async (text, algorithm = "SHA-256", secret, outputFormat = "hex")=>{
1025
- const key = await (0, $dxT2C$crypto.webcrypto).subtle.importKey("raw", new TextEncoder().encode(secret), {
1022
+ const key = await crypto.subtle.importKey("raw", new TextEncoder().encode(secret), {
1026
1023
  name: "HMAC",
1027
1024
  hash: algorithm
1028
1025
  }, false, [
@@ -1030,7 +1027,7 @@ const $256af523deaf5315$var$sign = async (text, algorithm = "SHA-256", secret, o
1030
1027
  ]);
1031
1028
  const encoder = new TextEncoder();
1032
1029
  const data = encoder.encode(text);
1033
- const hashBuffer = await (0, $dxT2C$crypto.webcrypto).subtle.sign("HMAC", key, data);
1030
+ const hashBuffer = await crypto.subtle.sign("HMAC", key, data);
1034
1031
  if (outputFormat === "hex") {
1035
1032
  const hashArray = Array.from(new Uint8Array(hashBuffer));
1036
1033
  return hashArray.map((b)=>b.toString(16).padStart(2, "0")).join("");