import { applyDefaults } from "https://deno.land/x/ana_utils@v0.0.1/src/utils.ts";
Inside Ana, there are interfaces that start with a lowercase i
, e.g. iAnaConfiguration
. These are input interfaces and have the same properties as their equivalent without the i
. So then, what is the difference between each other? All of the properties of an input interface must be optional. Because we can't force the developer to input all properties of a interface every time. In other words, if a developer wants to configure Ana, it shouldn't be a requirement to add all AnaConfiguration properties only to change one of them.
Then, the problem happens when trying to use the input interface. All values are optional, so it becomes verbose to validate each and everyone of them in a way simmilar to this: interface.property ? interface.property : undefined
. That's why we need the second non-input interface, where no property is optional. This function transforms iExample
into Example
using the default values found in dExample
.