Commit Graph

826 Commits

Author SHA1 Message Date
202cac81c0 Accept readonly array inputs
This changes some type definitions so that sheetjs accepts readonly arrays in places where it's not mutating the array anyway.

For example, without this change, the following code would not compile:
```
const myData: ReadonlyArray<{ col1: string, col2: string}> = [{ col1: 'a', col2: 'b' }];
const myWorksheet = utils. json_to_sheet(myData);
```
This theoretically should work - sheetjs isn't mutating the myData array anyway, so it should accept a readonly array as input.

Signed-off-by: Sweater-Baron <sweater-baron@noreply.git.sheetjs.com>
2025-03-26 18:49:46 +00:00
0e4eb976e1 export nits
- XLSX write dense mode null check (fixes #3261 h/t @mbornstein)
- Use `subarray` for Uint8Array/Buffer ops (h/t @hardonthebeat)
2025-02-22 15:18:51 -05:00
9c3853ba25 fix: missing break condition in make_json_row 2025-01-10 16:26:17 +05:30
318e2319ee ODS parse hyperlink tooltips 2024-11-10 21:27:04 -05:00
6c0f950f83 feat: Add Sheet Protection for XLS (BIFF8) (#3202)
Fixes #3201

Reviewed-on: sheetjs/sheetjs#3202
Co-authored-by: Lucas Picchi <lucas.picchi@exeo.com.ar>
Co-committed-by: Lucas Picchi <lucas.picchi@exeo.com.ar>
2024-10-26 20:37:20 +00:00
235ed7ccfb update CONTRIBUTING.md (fixes #3233 h/t @Akxe) 2024-10-21 09:43:40 -04:00
2d6c821261 Parse DIF-esque CSV (fixes #3230 h/t @lowkeyfish) 2024-10-02 01:04:56 -04:00
36debb0eaa RollupJS workaround (fixes #3219 h/t @lvzhenbo) 2024-09-19 19:45:18 -04:00
df48a059c3 Ignore negative sign for a symmetric rounding. 2024-09-18 17:31:02 -07:00
647cdb89f5 Add test files to .gitignore 2024-09-09 18:14:32 -03:00
6912bdb2d4 fix: Add DenseSheetData type (#3195) 2024-09-05 10:25:52 +08:00
5550b90704 fix: infinite loop due to hidden row in XLSX.stream.to_json (#3178)
**Title:**

Fix for Incorrect Row Indexing and Infinite Loop in stream.to_json Function

**Description:**

This pull request addresses two key issues in the `stream.to_json` function of the SheetJS library:

1. **Infinite Loop**: Previously, when a row was hidden, the function skipped processing the current row without incrementing the row counter `R`, resulting in an infinite loop during execution.

2. **Incorrect Row Indexing**: The row index was incorrectly accessed using a one-based index, whereas the actual row index was zero-based. This led to unintended hidden rows being included in the stream and skipping of subsequent non-hidden rows.

**Changes:**

- Modified the hidden row check to use the correct zero-based indexing
- Incremented `R` after identifying a hidden row to ensure the loop progresses to the next row.
- Ensured that the stream correctly processes all rows, skipping hidden rows without affecting subsequent rows.

**Testing:**

- Validated that the `stream.to_json` function no longer enters an infinite loop when encountering hidden rows.
- Confirmed that the correct rows are processed and pushed to the stream, with hidden rows being appropriately skipped.

**Impact:**

This fix enhances the reliability of the SheetJS library, ensuring accurate data streaming from spreadsheets without infinite loops or incorrect row handling.

**Checklist:**

- [x] Code changes have been tested locally.
- [x] The changes adhere to the project's coding standards and guidelines.

**Additional Information:**

These changes are crucial for maintaining the library's functionality in production environments, where precise data handling is essential.

**References:**

Closes #3176.

---

Reviewed-on: sheetjs/sheetjs#3178
Co-authored-by: deepak-negi-web <deepak-negi-web@noreply.git.sheetjs.com>
Co-committed-by: deepak-negi-web <deepak-negi-web@noreply.git.sheetjs.com>
2024-08-21 05:34:31 +00:00
9368a85b5f XLSX encoded entities (fixes #3177)
- HTML DOM ingress support formulae (`data-f`)
- Sheet Visibility for ODS / FODS (fixes #3162)
2024-08-19 12:43:37 -04:00
2669c7cf1c actually remove test_files submodule 2024-07-19 14:57:19 -04:00
b61eed74fc do not bail when XLS properies cannot be parsed 2024-07-17 14:23:02 -04:00
8a7cfd47bd version bump 0.20.3 2024-07-12 11:47:14 -04:00
f215b8f79f merge nits (fixes #3142 h/t @s-ashwin ) 2024-07-11 01:33:25 -04:00
5a36cb423d NaN and Infinity error export
- `read` handle `Int8Array` (to support Java engines)
- `sheet_to_formulae` option to suppress values
- handle unexpected `<charset/>` (fixes #3143 h/t @dearzubi)
2024-07-04 15:54:34 -04:00
5ef49e2b96 XLML Streaming Write
- CSV Export only quote leading ID (fixes #2959)
2024-05-31 03:16:53 -04:00
947a5178bd ssf format NaN and Infinity values 2024-04-27 19:49:12 -04:00
87a695747e docs: ✏️ Fixed broken links in contributing.md 2024-04-10 02:09:14 -07:00
a0bed2a97d version bump 0.20.2
see https://regexide.com for more details
2024-04-04 21:30:28 -04:00
0941ff97a3 dta v0.0.2 2024-03-22 00:39:09 -04:00
e4a66516e4 remove flow array comment workarounds
- XLSB use #REF! for unsupported defined name ref (fixes #3059 h/t @NenadC2)
2024-02-02 01:52:14 -05:00
d4d4ff3da2 SYLK error cells read/write (fixes #3049) 2024-01-10 04:54:10 -05:00
29d46c07a8 version bump 0.20.1 2023-12-05 03:19:42 -05:00
9199c2600c dta initial 2023-11-13 06:13:07 -05:00
cd5fafda32 ssf v0.11.3 2023-10-23 21:22:11 -04:00
David Szajngarten
c8e6d5c20f ssf seconds/hours time rounding 2023-10-23 13:25:42 -04:00
ad0fb7766b import and export blank worksheets 2023-10-17 04:53:37 -04:00
4cc980975b QPW string formula results
- mujs-compatible regices
- NUMBERS use row offsets (fixes #3009 h/t @relaxsnow)
2023-10-15 23:03:39 -04:00
432ac1fda7 xlsx-cli v1.1.4 2023-10-11 16:22:42 -04:00
53283217e9 xlsx-cli support dateFormat option (#3005)
Co-authored-by: Marlous Kottenhagen <m.kottenhagen@bigmile.eu>
Reviewed-on: sheetjs/sheetjs#3005
Co-authored-by: MarlousKottenhagen <marlouskottenhagen@noreply.git.sheetjs.com>
Co-committed-by: MarlousKottenhagen <marlouskottenhagen@noreply.git.sheetjs.com>
2023-10-10 06:50:32 +00:00
248108b667 dense types 2023-09-21 04:12:13 -04:00
julitork
766fc4f4d2 allow rawNumber override raw option 2023-08-29 16:04:32 +03:00
485a4f30f1 set CSV formula cell value to raw fmla text 2023-08-23 13:38:14 -04:00
68cce77d23 package.json exports (fixes #2977 h/t @stof) 2023-08-20 21:01:07 -04:00
c0b9e229a0 Delete .github/ISSUE_TEMPLATE/config.yml 2023-08-18 15:26:54 +00:00
955543147d version bump 0.20.0 2023-06-23 05:48:47 -04:00
36c5b7c0f5 NUMBERS read/write threaded comments 2023-06-14 03:47:51 -04:00
6e260c9185 cell comments
- `sheet_to_json` handle arrays (h/t AaronWoodrow)
- XLS parse comment visibility (h/t Godrules500)
- chrome manifest v3 writeFile support
- raw v8 (no TextEncoder/TextDecoder) optimization
- handle empty shared formula body (h/t florian)
2023-06-13 00:49:18 -04:00
d3a480750b NUMBERS read/write external links 2023-05-13 01:23:26 -04:00
5b33acfaf4 parse self-closing text:p uof:文本串 (fixes #2927) 2023-04-30 03:57:30 -04:00
b68eaed726 Export NaN/Infinity to error cells (fixes #2897) 2023-04-23 03:58:36 -04:00
333e4e40f9 version bump 0.19.3 2023-04-17 23:39:28 -04:00
af8e3d9171 build fixes for macOS Ventura 2023-04-14 03:51:02 -04:00
Vsevolod Kokorin
dca90c8024 XLSX Ensure comment address is valid 2023-04-12 03:48:54 -04:00
c06a32043f Add ESM helper methods to CJS build (fixes #2909) 2023-04-10 01:15:44 -04:00
ffbea71bc2 XLS ExternSheet record (fixes #2907) 2023-04-05 15:34:55 -04:00
16dd8a6eae UTF16LE sans codepage (fixes #2898 h/t @brismuth) 2023-03-15 04:17:09 -04:00