@truto/truto-jsonata 1.0.0 → 1.0.2

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/main.cjs CHANGED
@@ -10,7 +10,6 @@ var $dxT2C$crypto = require("crypto");
10
10
  var $dxT2C$xmljs = require("xml-js");
11
11
  var $dxT2C$json2md = require("json2md");
12
12
  var $dxT2C$mime = require("mime");
13
- var $dxT2C$honoutilsencode = require("hono/utils/encode");
14
13
 
15
14
  function $parcel$interopDefault(a) {
16
15
  return a && a.__esModule ? a.default : a;
@@ -898,9 +897,9 @@ const $6c8155c4308ceae8$var$formatPlainText = (x)=>{
898
897
  const $6c8155c4308ceae8$var$convertNotionToMd = function(block, level = 1) {
899
898
  const n = "\n\n";
900
899
  const data = block[block.type];
901
- const plainText = data.rich_text ? data.rich_text.map($6c8155c4308ceae8$var$formatPlainText) : [];
900
+ const plainText = data.rich_text ? data?.rich_text.map($6c8155c4308ceae8$var$formatPlainText) : [];
902
901
  // @ts-ignore
903
- const caption = data.caption ? data.caption.map((x)=>x?.plain_text) : [];
902
+ const caption = data?.caption ? data.caption.map((x)=>x?.plain_text) : [];
904
903
  let childData = "";
905
904
  switch(block.type){
906
905
  case "bookmark":
@@ -1243,9 +1242,15 @@ function $b3c3220fc07098c9$var$uuid() {
1243
1242
  var $b3c3220fc07098c9$export$2e2bcd8739ae039 = $b3c3220fc07098c9$var$uuid;
1244
1243
 
1245
1244
 
1246
-
1247
- function $1b5edce2fe329e3e$var$base64encode(arg) {
1248
- return (0, $dxT2C$honoutilsencode.encodeBase64)(new TextEncoder().encode(arg));
1245
+ function $1b5edce2fe329e3e$var$base64encode(input, urlSafe = false) {
1246
+ let binary = "";
1247
+ let bytes;
1248
+ bytes = new TextEncoder().encode(input);
1249
+ const len = bytes.length;
1250
+ for(let i = 0; i < len; i++)binary += String.fromCharCode(bytes[i]);
1251
+ let base64 = btoa(binary);
1252
+ if (urlSafe) base64 = base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
1253
+ return base64;
1249
1254
  }
1250
1255
  var $1b5edce2fe329e3e$export$2e2bcd8739ae039 = $1b5edce2fe329e3e$var$base64encode;
1251
1256
 
@@ -1320,9 +1325,13 @@ function $9cdb7c76a5e196f3$var$zipSqlResponse(columns, data, key) {
1320
1325
  var $9cdb7c76a5e196f3$export$2e2bcd8739ae039 = $9cdb7c76a5e196f3$var$zipSqlResponse;
1321
1326
 
1322
1327
 
1323
-
1324
- function $77081a2d6d46cd50$var$base64decode(arg) {
1325
- return new TextDecoder("utf-8").decode((0, $dxT2C$honoutilsencode.decodeBase64)(arg));
1328
+ function $77081a2d6d46cd50$var$base64decode(base64, urlSafe = false) {
1329
+ if (urlSafe) base64 = base64.replace(/-/g, "+").replace(/_/g, "/");
1330
+ const binary = atob(base64);
1331
+ const len = binary.length;
1332
+ const bytes = new Uint8Array(len);
1333
+ for(let i = 0; i < len; i++)bytes[i] = binary.charCodeAt(i);
1334
+ return new TextDecoder().decode(bytes);
1326
1335
  }
1327
1336
  var $77081a2d6d46cd50$export$2e2bcd8739ae039 = $77081a2d6d46cd50$var$base64decode;
1328
1337