@vdhewei/xlsx-template-lib 1.3.1 → 1.3.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/index.js CHANGED
@@ -3513,21 +3513,26 @@ var compileRowCells = function(ctx, expr, cellPoints, rowIndex, errs) {
3513
3513
  return;
3514
3514
  }
3515
3515
  ctx.currentExpr = expr;
3516
- cellPoints.forEach((cellPoint, index) => {
3517
- const r = cellPoint.Row;
3518
- const sheet = ctx.sheet;
3519
- const c = cellPoint.Column;
3520
- const cell = sheet.findCell(r, c);
3521
- if (cell === void 0 || cell.value !== void 0 && cell.value !== null && cell.value !== "") {
3522
- return;
3523
- }
3524
- let templateValue = String(expr.value);
3525
- const macroTokens2 = getMacroTokens(expr);
3526
- templateValue = resolveFunctionExpr(ctx, templateValue, expr);
3527
- templateValue = resolveCompileMacroExpr(ctx, templateValue, macroTokens2, index, cellPoints.length);
3528
- templateValue = resolveAliasExpr(ctx, templateValue, index);
3529
- cell.value = resolveValueExpr(ctx, templateValue);
3530
- });
3516
+ try {
3517
+ cellPoints.forEach((cellPoint, index) => {
3518
+ const r = cellPoint.Row;
3519
+ const sheet = ctx.sheet;
3520
+ const c = cellPoint.Column;
3521
+ const cell = sheet.findCell(r, c);
3522
+ if (cell === void 0 || cell.value !== void 0 && cell.value !== null && cell.value !== "") {
3523
+ return;
3524
+ }
3525
+ let templateValue = String(expr.value);
3526
+ const macroTokens2 = getMacroTokens(expr);
3527
+ templateValue = resolveFunctionExpr(ctx, templateValue, expr);
3528
+ templateValue = resolveCompileMacroExpr(ctx, templateValue, macroTokens2, index, cellPoints.length);
3529
+ templateValue = resolveAliasExpr(ctx, templateValue, index);
3530
+ cell.value = resolveValueExpr(ctx, templateValue);
3531
+ });
3532
+ } catch (err) {
3533
+ const msg = err.message;
3534
+ throw new Error(`expr:${expr.express}, resolve error: ${msg}`);
3535
+ }
3531
3536
  };
3532
3537
  var generateWorkSheetCellsPlaceholder = function(ctx, expr, sheet) {
3533
3538
  const errs = [];