The property that should be called on the object. Can be an array.
The default value it'll fallback to if one of the properties doesn't exist.
The base value.
Objects that'll be inputted. It is a sweeper functions so you can add in however much you'd like.
Generated using TypeDoc, the 2/8/2021 at 8:46:57 AM
Add multiple properties togethor to calculate a number. inputs is a sweeper.
import { addProp } from 'tyvn';
addProp<{ one: number, two: number }>(['one', 'two'], 5, { one: 1, two: 2 }); // 3 addProp<{ one: number, two: number }>('one', 5, { one: 1, two: 2 }); // 1 addProp<{ one: number, two: number }>(['one', 'two'], 5, { one: 1, two: 'Hello world!' }); // 6 addProp<{ one: number; two: number }>(['one', 'two'], 5, 0, { one: 6, two: 3 }, { one: 9, two: 12 }); // 30