Skip to content

Instantly share code, notes, and snippets.

@adrianlee
Created May 3, 2019 18:26
Show Gist options
  • Save adrianlee/9104c65a12e7c4986c7b2314e7a81a69 to your computer and use it in GitHub Desktop.
Save adrianlee/9104c65a12e7c4986c7b2314e7a81a69 to your computer and use it in GitHub Desktop.
[
'{{repeat(5, 7)}}',
{
_id: '{{objectId()}}',
index: '{{index()}}',
guid: '{{guid()}}',
isActive: '{{bool()}}',
balance: '{{floating(1000, 4000, 2, "$0,0.00")}}',
picture: 'http://placehold.it/32x32',
age: '{{integer(20, 40)}}',
eyeColor: '{{random("blue", "brown", "green")}}',
name: '{{firstName()}} {{surname()}}',
tags: [
'{{repeat(7)}}',
'{{lorem(1, "words")}}'
],
friends: [
'{{repeat(3)}}',
{
id: '{{index()}}',
name: '{{firstName()}} {{surname()}}'
}
],
greeting: function (tags) {
return 'Hello, ' + this.name + '! You have ' + tags.integer(1, 10) + ' unread messages.';
},
favoriteFruit: function (tags) {
var fruits = ['apple', 'banana', 'strawberry'];
return fruits[tags.integer(0, fruits.length - 1)];
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment