Commit Graph

5 Commits

Author SHA1 Message Date
autofix-ci[bot]
ab85b8597f [autofix.ci] apply automated fixes 2025-08-29 08:54:53 +00:00
Claude Bot
8e06c89421 Simplify Bun.TOML.stringify API to match JSON.stringify pattern
- Remove complex options like `inlineTables` to keep API simple and focused
- Follow JSON.stringify(value, replacer, space) signature but ignore replacer/space
- Improve nested object handling with proper dotted table paths
- Add comprehensive tests for deeply nested objects and round-trip compatibility
- Throw error for unsupported replacer parameter (following YAML.stringify pattern)
- Update TypeScript definitions to reflect simplified API

The API is now much cleaner and matches the pattern established by Bun.YAML.stringify:
- Single parameter: `TOML.stringify(obj)`
- JSON.stringify-like: `TOML.stringify(obj, null, space)` (space ignored)
- Proper error for replacer: `TOML.stringify(obj, fn)` throws

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 08:52:12 +00:00
Claude Bot
e587194b3a Improve TOML.stringify API with TypeScript overloads and simplified options
- Replace union type with TypeScript function overloads for cleaner IntelliSense
- Simplify TOML options to only include `inlineTables` (most essential option)
- Remove `arraysMultiline` and `indent` options for consistent formatting
- Update memory management to use ArenaAllocator for better cleanup
- Update test snapshots to match new array formatting (no multiline for <4 elements)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 11:24:05 +00:00
autofix-ci[bot]
cbb177129d [autofix.ci] apply automated fixes 2025-08-28 11:03:44 +00:00
Claude Bot
0cd5ce2ac0 Implement Bun.TOML.stringify API
Major features implemented:
- Core TOML stringify functionality with comprehensive error handling
- Support for all basic TOML types: strings, numbers, booleans, arrays, tables
- Options support: inlineTables, arraysMultiline, indent
- Proper string escaping with control character handling
- Special float value support (nan, inf, -inf)
- Key validation and quoting when necessary
- Table and inline table formatting
- TypeScript type definitions with comprehensive documentation
- Comprehensive test suite covering basic and advanced functionality

API Features:
- Bun.TOML.stringify(value, replacer?, options?)
- Options: inlineTables, arraysMultiline, indent
- Error messages for different failure modes
- Round-trip compatibility with Bun.TOML.parse()

The implementation provides a solid foundation for TOML stringification
in Bun, following similar patterns to JSON.stringify and YAML.stringify.
Memory management has been carefully handled to prevent use-after-free
issues in the JavaScript runtime.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 10:51:20 +00:00