@cj-tech-master/excelts 9.5.6 → 9.5.7

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.
@@ -54,7 +54,20 @@ export declare function extractFontProperties(font: Partial<PdfFontStyle> | unde
54
54
  */
55
55
  export declare function excelFillToPdfColor(fill: PdfFillData | undefined): PdfColor | null;
56
56
  /**
57
- * Map border styles to PDF line widths.
57
+ * Map border styles to PDF line widths (in points).
58
+ *
59
+ * Values match Excel's actual border weights as used historically by this
60
+ * library (pre-#154). PR #154 doubled every width (0.25 → 0.5, 0.5 → 1,
61
+ * 1 → 2) to make `thin` and `medium` more visually distinct in PDF
62
+ * viewers, but that change made all borders heavier than Excel itself
63
+ * (issue #164). The 2× ratio between thin/medium and the 4× ratio between
64
+ * thin/thick are preserved with the lighter values, so styles remain
65
+ * distinguishable while matching Excel.
66
+ *
67
+ * hair = 0.1 pt
68
+ * thin = 0.25 pt (also dotted, dashed, dashDot, dashDotDot, slantDashDot, double)
69
+ * medium = 0.5 pt (also mediumDashed, mediumDashDot, mediumDashDotDot)
70
+ * thick = 1 pt
58
71
  */
59
72
  export declare function borderStyleToLineWidth(style: string): number;
60
73
  /**
@@ -274,38 +274,51 @@ export function excelFillToPdfColor(fill) {
274
274
  // Border Conversion
275
275
  // =============================================================================
276
276
  /**
277
- * Map border styles to PDF line widths.
277
+ * Map border styles to PDF line widths (in points).
278
+ *
279
+ * Values match Excel's actual border weights as used historically by this
280
+ * library (pre-#154). PR #154 doubled every width (0.25 → 0.5, 0.5 → 1,
281
+ * 1 → 2) to make `thin` and `medium` more visually distinct in PDF
282
+ * viewers, but that change made all borders heavier than Excel itself
283
+ * (issue #164). The 2× ratio between thin/medium and the 4× ratio between
284
+ * thin/thick are preserved with the lighter values, so styles remain
285
+ * distinguishable while matching Excel.
286
+ *
287
+ * hair = 0.1 pt
288
+ * thin = 0.25 pt (also dotted, dashed, dashDot, dashDotDot, slantDashDot, double)
289
+ * medium = 0.5 pt (also mediumDashed, mediumDashDot, mediumDashDotDot)
290
+ * thick = 1 pt
278
291
  */
279
292
  export function borderStyleToLineWidth(style) {
280
293
  switch (style) {
294
+ case "hair":
295
+ return 0.1;
281
296
  case "thin":
282
- return 0.5;
297
+ return 0.25;
283
298
  case "medium":
284
- return 1.0;
299
+ return 0.5;
285
300
  case "thick":
286
- return 2.0;
301
+ return 1;
287
302
  case "double":
288
- return 0.5;
289
- case "hair":
290
- return 0.2;
303
+ return 0.25;
291
304
  case "dotted":
292
- return 0.5;
305
+ return 0.25;
293
306
  case "dashed":
294
- return 0.5;
307
+ return 0.25;
295
308
  case "dashDot":
296
- return 0.5;
309
+ return 0.25;
297
310
  case "dashDotDot":
298
- return 0.5;
311
+ return 0.25;
299
312
  case "slantDashDot":
300
- return 0.5;
313
+ return 0.25;
301
314
  case "mediumDashed":
302
- return 1.0;
315
+ return 0.5;
303
316
  case "mediumDashDot":
304
- return 1.0;
317
+ return 0.5;
305
318
  case "mediumDashDotDot":
306
- return 1.0;
307
- default:
308
319
  return 0.5;
320
+ default:
321
+ return 0.25;
309
322
  }
310
323
  }
311
324
  /**
@@ -286,38 +286,51 @@ function excelFillToPdfColor(fill) {
286
286
  // Border Conversion
287
287
  // =============================================================================
288
288
  /**
289
- * Map border styles to PDF line widths.
289
+ * Map border styles to PDF line widths (in points).
290
+ *
291
+ * Values match Excel's actual border weights as used historically by this
292
+ * library (pre-#154). PR #154 doubled every width (0.25 → 0.5, 0.5 → 1,
293
+ * 1 → 2) to make `thin` and `medium` more visually distinct in PDF
294
+ * viewers, but that change made all borders heavier than Excel itself
295
+ * (issue #164). The 2× ratio between thin/medium and the 4× ratio between
296
+ * thin/thick are preserved with the lighter values, so styles remain
297
+ * distinguishable while matching Excel.
298
+ *
299
+ * hair = 0.1 pt
300
+ * thin = 0.25 pt (also dotted, dashed, dashDot, dashDotDot, slantDashDot, double)
301
+ * medium = 0.5 pt (also mediumDashed, mediumDashDot, mediumDashDotDot)
302
+ * thick = 1 pt
290
303
  */
291
304
  function borderStyleToLineWidth(style) {
292
305
  switch (style) {
306
+ case "hair":
307
+ return 0.1;
293
308
  case "thin":
294
- return 0.5;
309
+ return 0.25;
295
310
  case "medium":
296
- return 1.0;
311
+ return 0.5;
297
312
  case "thick":
298
- return 2.0;
313
+ return 1;
299
314
  case "double":
300
- return 0.5;
301
- case "hair":
302
- return 0.2;
315
+ return 0.25;
303
316
  case "dotted":
304
- return 0.5;
317
+ return 0.25;
305
318
  case "dashed":
306
- return 0.5;
319
+ return 0.25;
307
320
  case "dashDot":
308
- return 0.5;
321
+ return 0.25;
309
322
  case "dashDotDot":
310
- return 0.5;
323
+ return 0.25;
311
324
  case "slantDashDot":
312
- return 0.5;
325
+ return 0.25;
313
326
  case "mediumDashed":
314
- return 1.0;
327
+ return 0.5;
315
328
  case "mediumDashDot":
316
- return 1.0;
329
+ return 0.5;
317
330
  case "mediumDashDotDot":
318
- return 1.0;
319
- default:
320
331
  return 0.5;
332
+ default:
333
+ return 0.25;
321
334
  }
322
335
  }
323
336
  /**
@@ -274,38 +274,51 @@ export function excelFillToPdfColor(fill) {
274
274
  // Border Conversion
275
275
  // =============================================================================
276
276
  /**
277
- * Map border styles to PDF line widths.
277
+ * Map border styles to PDF line widths (in points).
278
+ *
279
+ * Values match Excel's actual border weights as used historically by this
280
+ * library (pre-#154). PR #154 doubled every width (0.25 → 0.5, 0.5 → 1,
281
+ * 1 → 2) to make `thin` and `medium` more visually distinct in PDF
282
+ * viewers, but that change made all borders heavier than Excel itself
283
+ * (issue #164). The 2× ratio between thin/medium and the 4× ratio between
284
+ * thin/thick are preserved with the lighter values, so styles remain
285
+ * distinguishable while matching Excel.
286
+ *
287
+ * hair = 0.1 pt
288
+ * thin = 0.25 pt (also dotted, dashed, dashDot, dashDotDot, slantDashDot, double)
289
+ * medium = 0.5 pt (also mediumDashed, mediumDashDot, mediumDashDotDot)
290
+ * thick = 1 pt
278
291
  */
279
292
  export function borderStyleToLineWidth(style) {
280
293
  switch (style) {
294
+ case "hair":
295
+ return 0.1;
281
296
  case "thin":
282
- return 0.5;
297
+ return 0.25;
283
298
  case "medium":
284
- return 1.0;
299
+ return 0.5;
285
300
  case "thick":
286
- return 2.0;
301
+ return 1;
287
302
  case "double":
288
- return 0.5;
289
- case "hair":
290
- return 0.2;
303
+ return 0.25;
291
304
  case "dotted":
292
- return 0.5;
305
+ return 0.25;
293
306
  case "dashed":
294
- return 0.5;
307
+ return 0.25;
295
308
  case "dashDot":
296
- return 0.5;
309
+ return 0.25;
297
310
  case "dashDotDot":
298
- return 0.5;
311
+ return 0.25;
299
312
  case "slantDashDot":
300
- return 0.5;
313
+ return 0.25;
301
314
  case "mediumDashed":
302
- return 1.0;
315
+ return 0.5;
303
316
  case "mediumDashDot":
304
- return 1.0;
317
+ return 0.5;
305
318
  case "mediumDashDotDot":
306
- return 1.0;
307
- default:
308
319
  return 0.5;
320
+ default:
321
+ return 0.25;
309
322
  }
310
323
  }
311
324
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v9.5.6
2
+ * @cj-tech-master/excelts v9.5.7
3
3
  * Zero-dependency TypeScript toolkit — Excel (XLSX), PDF, CSV, Markdown, XML, ZIP/TAR, and streaming.
4
4
  * (c) 2026 cjnoname
5
5
  * Released under the MIT License
@@ -88940,24 +88940,37 @@ self.onmessage = async function(event) {
88940
88940
  return null;
88941
88941
  }
88942
88942
  /**
88943
- * Map border styles to PDF line widths.
88943
+ * Map border styles to PDF line widths (in points).
88944
+ *
88945
+ * Values match Excel's actual border weights as used historically by this
88946
+ * library (pre-#154). PR #154 doubled every width (0.25 → 0.5, 0.5 → 1,
88947
+ * 1 → 2) to make `thin` and `medium` more visually distinct in PDF
88948
+ * viewers, but that change made all borders heavier than Excel itself
88949
+ * (issue #164). The 2× ratio between thin/medium and the 4× ratio between
88950
+ * thin/thick are preserved with the lighter values, so styles remain
88951
+ * distinguishable while matching Excel.
88952
+ *
88953
+ * hair = 0.1 pt
88954
+ * thin = 0.25 pt (also dotted, dashed, dashDot, dashDotDot, slantDashDot, double)
88955
+ * medium = 0.5 pt (also mediumDashed, mediumDashDot, mediumDashDotDot)
88956
+ * thick = 1 pt
88944
88957
  */
88945
88958
  function borderStyleToLineWidth(style) {
88946
88959
  switch (style) {
88947
- case "thin": return .5;
88948
- case "medium": return 1;
88949
- case "thick": return 2;
88950
- case "double": return .5;
88951
- case "hair": return .2;
88952
- case "dotted": return .5;
88953
- case "dashed": return .5;
88954
- case "dashDot": return .5;
88955
- case "dashDotDot": return .5;
88956
- case "slantDashDot": return .5;
88957
- case "mediumDashed": return 1;
88958
- case "mediumDashDot": return 1;
88959
- case "mediumDashDotDot": return 1;
88960
- default: return .5;
88960
+ case "hair": return .1;
88961
+ case "thin": return .25;
88962
+ case "medium": return .5;
88963
+ case "thick": return 1;
88964
+ case "double": return .25;
88965
+ case "dotted": return .25;
88966
+ case "dashed": return .25;
88967
+ case "dashDot": return .25;
88968
+ case "dashDotDot": return .25;
88969
+ case "slantDashDot": return .25;
88970
+ case "mediumDashed": return .5;
88971
+ case "mediumDashDot": return .5;
88972
+ case "mediumDashDotDot": return .5;
88973
+ default: return .25;
88961
88974
  }
88962
88975
  }
88963
88976
  /**