namespace Popcorn.Common
generator append(any inp)
generator append(any[] ar)
inp
- the value to append.ar
- the values to append. The resulting array
contains one object for every array element.gen
- the generator of which result is appended
to the base object value. generator[string] concat([generator/primitives] value)
value
- single value
generators or primitives to concatenate. generator date(milisec from, milisec to, string format)
from
- from dateto
- to dateformat
- the output format, possible values are: date, hours, minutes, seconds, time, gmt.
By default data prints the local time string. generator join(any+ args)
args
- values, arrays or generators. generator[any] list(any+ args)
var o = { name : 'Woody' } var gen = { name : list('Buzz', 'Slinky'); generate(gen, o) will return: [{ name : 'Buzz' }, { name : 'Slinky' }]
args
- the values to generate. generator now(string format)
format
- the output format, possible values are: date, hours, minutes, seconds, time, gmt.
By default data prints the local time string. generator prepend(any inp)
generator prepend(any[] ar)
var o = { name : 'Head' } generate({ name : prepend('Mr. Potato ') }, o) will generate: [{ name : 'Mr. Potato Head' }]
inp
- the value to prepend.ar
- the values to prepend. The resulting array
contains one object for every array element.gen
- the generator of which result is prepended
to the base object value.var o = { int : 0 } var gen = { int : range(1, 3); generate(gen, o) will return: [{ int : 1 }, { int : 2 }, { int : 3 }]
max
- range max value.min
- from integermax
- to integer