mennovanslooten/mockJSON — pull request #16 by asyncanup (2014-08-25 14:34:09+00:00)
Title: Add limited random latency feature

Really needed the feature to simulate real-world latency, so here it is :)

Usage:

$.mockJSON('/mock-request', template, 1500);

Now this request will return some time between 0 and 1500 ms.

Second, allowed arrays to be entered in template without a compulsory vertical bar "|", so that static arrays can be a part of the template.

Additionally, moved the sections of code around a bit for better comprehension and JSHint compliance, but that's a matter of style, so I would just move it back if you say so :)