@onyx-p/imlib-web 1.7.9 → 1.8.0

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/index.esm.js CHANGED
@@ -20379,11 +20379,16 @@ const parseMediaAttributeJson = (mediaConstructor, mediaAttribute, msgPostConten
20379
20379
  mediaAttributeJson.content = msgPostContent;
20380
20380
  } else {
20381
20381
  if (mediaAttribute?.length) {
20382
- mediaAttributeJson = JSON.parse(mediaAttribute);
20382
+ const safeJsonString = convertInt64ToString(mediaAttribute);
20383
+ mediaAttributeJson = JSON.parse(safeJsonString);
20383
20384
  }
20384
20385
  }
20385
20386
  return mediaAttributeJson;
20386
20387
  };
20388
+ const convertInt64ToString = jsonString => {
20389
+ const int64Regex = /:\s*(\d{15,})/g;
20390
+ return jsonString.replace(int64Regex, (match, number) => `: "${number}"`);
20391
+ };
20387
20392
  const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
20388
20393
  let contentList = [];
20389
20394
  msgDetails.forEach(item => {
package/index.umd.js CHANGED
@@ -20385,11 +20385,16 @@
20385
20385
  mediaAttributeJson.content = msgPostContent;
20386
20386
  } else {
20387
20387
  if (mediaAttribute?.length) {
20388
- mediaAttributeJson = JSON.parse(mediaAttribute);
20388
+ const safeJsonString = convertInt64ToString(mediaAttribute);
20389
+ mediaAttributeJson = JSON.parse(safeJsonString);
20389
20390
  }
20390
20391
  }
20391
20392
  return mediaAttributeJson;
20392
20393
  };
20394
+ const convertInt64ToString = jsonString => {
20395
+ const int64Regex = /:\s*(\d{15,})/g;
20396
+ return jsonString.replace(int64Regex, (match, number) => `: "${number}"`);
20397
+ };
20393
20398
  const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
20394
20399
  let contentList = [];
20395
20400
  msgDetails.forEach(item => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "1.7.9",
3
+ "version": "1.8.0",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",