flatbuffers/ts
Iñaki Baz Castillo 3211f857d1
Add --ts-undefined-for-optionals command line option (#8861)
* Add --ts-undefined-for-optionals command line option

# Details

- Fixes #7656
- Added a new `--ts-undefined-for-optionals` command line option for `flatc`.
- If enabled, generated TypeScript code uses `undefined` for optional fields rather than `null`.

* Also add TS generated test files

* Run `sh scripts/clang-format-git.sh`

* also add tests/ts/lalala-options.ts to the repo

* move new tests to tests/ts/optional_values dir

* add tests/ts/optional_values/optional_values_generated.cjs to the repo

* reuse existing optional_scalars.fbs and add new test

* add comma

* sh scripts/clang-format-git.sh

* remove comma

* sh scripts/clang-format-git.sh

* trying things

* sh scripts/clang-format-git.sh

* done

* address feedback

* sh scripts/clang-format-git.sh

* run `sh scripts/clang-format-git.sh`

* remove uneeded `eslint-disable @typescript-eslint/no-namespace` line

---------

Co-authored-by: José Luis Millán <jmillan@aliax.net>
2026-02-04 13:37:41 +01:00
..
flexbuffers [TS] Flexbuffers root vector fix (#8847) 2025-12-14 22:59:27 +01:00
BUILD.bazel Rust reflection: simplify dependencies, fix Android build compatibility (#8512) 2025-02-04 08:40:31 -08:00
builder.ts Add --ts-undefined-for-optionals command line option (#8861) 2026-02-04 13:37:41 +01:00
byte-buffer.ts TypeScript: read vtable entries as uint16 (#8435) 2025-11-27 10:55:34 +00:00
compile_flat_file.sh Migrate from rules_nodejs to rules_js/rules_ts (take 2) (#7928) 2023-05-03 11:48:15 -07:00
constants.ts bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
encoding.ts bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
flatbuffers.ts bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
flexbuffers.ts Add --ts-undefined-for-optionals command line option (#8861) 2026-02-04 13:37:41 +01:00
package.json Bump the versions of all aspect Bazel dependencies (#8508) 2025-01-24 10:09:22 -08:00
pnpm-lock.yaml Fix npm bzlmod (#8506) 2025-01-23 21:01:31 +00:00
types.ts bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00
utils.ts bulk code format fix (#8707) 2025-09-23 21:50:27 -07:00