Skip to content

Helix - v0.0.11

Compare
Choose a tag to compare
@ItsJonQ ItsJonQ released this 13 Nov 19:40
· 37 commits to master since this release

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.