rapid-spreadjs 1.0.180 → 1.0.181

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/index.esm.js CHANGED
@@ -1207,7 +1207,10 @@ const BusinessUtils = {
1207
1207
  const letters = ['a', 'b', 'c', 'd', 'e', 'f'];
1208
1208
  letters.forEach((letter) => {
1209
1209
  if (itemExp.indexOf(letter) > -1) {
1210
- itemExp = itemExp.replaceAll(letter, varJsonObjs.find((itemVar) => itemVar.var == letter).value);
1210
+ const findVal = varJsonObjs.find((itemVar) => itemVar.var == letter).value;
1211
+ // 如果findVal为数字,则使用数字,否则使用字符串(加上双引号)
1212
+ const replaceVal = /^(-?\d+)(\.\d+)?$/.test(findVal) ? findVal : `"${findVal}"`;
1213
+ itemExp = itemExp.replaceAll(letter, replaceVal);
1211
1214
  }
1212
1215
  });
1213
1216
  return itemExp;