This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
JSON import and object casting to TS model #46
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm closing this, both because of git issues, and because I can't figure out a bug related to my use of
@Type
.My focus is on the input data end, since that's where the obvious immediate need is (methods to format and process names, dates, etc.).
Something like this should work for edtf dates:
EDIT: it likely won't, because EDTF is a complex model.
Also, at least by default, EDTF.js will fail loudly if the string you feed it isn't valid. So would need to do a type check first.
Still unsure on the details of date formatting config, but am including here also.
Here's an example as internally represented.
Note:
Been driving myself crazy assuming a bug on my end, but seems that it may this:
typestack/class-transformer#1510
Links:
https://stackoverflow.com/questions/76112334/discriminating-type-based-on-presence-of-different-properties
typestack/class-transformer#857 (comment)