JuliaData / StructTypes.jl

Abstract definitions and convenience methods for describing, processing, and constructing Julia objects
https://juliadata.github.io/StructTypes.jl/stable/
MIT License
80 stars 22 forks source link

Add optional setting of defaults for Structs #79

Closed kshyatt closed 2 years ago

kshyatt commented 2 years ago

Previously requested by @Roger-luo and others. merge(::NamedTuple, ::Dict) works so this should be safe even if the input to constructfrom is a Dict. Happy to make modifications/expand to UnorderedStruct and CustomStruct if anyone would like.

codecov[bot] commented 2 years ago

Codecov Report

Merging #79 (87868f3) into main (8292c95) will increase coverage by 0.05%. The diff coverage is 77.77%.

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   72.65%   72.70%   +0.05%     
==========================================
  Files           2        2              
  Lines         362      370       +8     
==========================================
+ Hits          263      269       +6     
- Misses         99      101       +2     
Impacted Files Coverage Δ
src/StructTypes.jl 72.14% <77.77%> (+0.06%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.