Helix - v0.0.11
Add new derived()
function for better computeds
🍐 with @alisdair to add a new function that allows you to create
computed values based on existing data within the shape of the Spec.
Example
const Spec = createSpec({
fname: () => 'Alice',
lname: () => 'Baker',
name: derived(({ fname, lname }) => `${fname} ${lname}`)
})
const fixture = Spec.generate()
Output
{
fname: 'Alice',
lname: 'Baker',
name: 'Alice Baker'
}
faker.computed()
has been deprecated in favour of the new derived()
function.