szld-libs 0.4.54 → 0.4.57

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.
@@ -7,7 +7,8 @@ function getJson(jsonStr) {
7
7
  try {
8
8
  return JSON.parse(jsonStr);
9
9
  } catch (error) {
10
- return {};
10
+ const fixedData = jsonStr.replace(/\\_/g, "_");
11
+ return fixedData ? JSON.parse(fixedData) : {};
11
12
  }
12
13
  }
13
14
  function base64ToString(base64Str) {
@@ -227,7 +228,7 @@ const processItem = (item, extraAttrs, notDisplay) => {
227
228
  if (!item.json && item.info) {
228
229
  try {
229
230
  const infoStr = item.info_base64 === 1 ? base64ToString(item.info) : item.info;
230
- const json = getJson(infoStr);
231
+ const json = typeof infoStr === "string" ? getJson(infoStr) : infoStr;
231
232
  const _extraAttrs = _.cloneDeep(extraAttrs) || {};
232
233
  const { langConfig = [], attrLangConfig = [] } = _extraAttrs || {};
233
234
  _extraAttrs == null ? true : delete _extraAttrs.langConfig;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.4.54",
4
+ "version": "0.4.57",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",