casual
casual copied to clipboard
populate() with custom generator returns "[object Object]"
casual.define('mygen', function() {
return {
x: 1
};
});
var result = casual.populate('{{mygen}}');
I thought it was a stringify
issue, but it actually returns a string instead of an object. Am i missing something here?
Hi, what exact output are you expecting in this example?
populate
just replaces placeholders with output of specified generator.
I had assumed it would return"{x: 1}"