The deep properties add properties to the objects created from your stamps. These are default properties of your objects. But unlike regular (shallow) properties these are deeply merged together by stamp deep merging algorithm.
The deepProperties are deeply merged using stamp deep merging algorithm. See below - the Secrets value is always a new object.
S3KeyIdAndSecret().Secrets !==DefaultSecrets().Secrets // NEVER EQUAL! NO MATTER WHAT!
Sometimes a regular (shallow) property has the same name as a deep property. While creating an object instance the shallow property wins. See stamp internals.
constNullSecrets=stampit.props({ Secrets:null})constAuthServiceToken=stampit.deepProps({ Secrets: { authServiceToken:process.env.AUTH_SERVICE_TOKEN }})constResult=NullSecrets.compose(AuthServiceToken)Result().Secrets ===null// the regular property overwrites deep property while creating an object
Other ways to add deep properties
Exactly the same stamp can be created in few ways. Here they all are.