Comments (1)
The parser step is currently quite lossy, as it doesn't preserve comment information (nor formatting). If you read a toml file and stringify it back, it will produce a "full" table; which means mostly the same thing but is most likely unwanted.
Because the lib maps toml files to plain objects (without intermediary attributes), I'm not sure how to keep track of comments (and possibly other metadata such as "is this table an inline table" for formatting purposes) in the output. I'm not sure I like the extra key way, as this doesn't preserve information about where the comment was...
I thought about having the library expose metadata via content[Symbol('smol-toml::metadata')]
, that'd be able to hold everything but I'm not sure about that approach either. It would allow any data to be in there so it could preserve everything (formatting, comments, etc...) making the lib suitable for non-destructive toml editing.
Do you have any opinions on this?
from smol-toml.
Related Issues (10)
- Encode support HOT 4
- Failing Valid Compliance Tests HOT 1
- Export the `parseKey` function for parse/validate keys outside the parse process?
- Is it possible to specify style? HOT 4
- Stringify on array of objects runs into error HOT 2
- Preserve fields with empty array values when converting json to toml format? HOT 2
- Cannot import package HOT 5
- Explicit type for parse HOT 5
- Automated Testing and Deployment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smol-toml.