basicallydan/interfake — pull request #9 by bruce-one (2014-03-24 05:43:42+00:00)
Title: Support for delaying responses a random amount within a specified range

I've added support for variably delayed responses, but I'm not entirely sold as to whether it's the best way to handle it...

The syntax is inspired by the Ruby range syntax (among others) as I wasn't sure the best way to go about it (so I thought I'd try it out and see :-) )

So it's: {delay: "10..100"}, for example, where the response would be a random amount of time between 10 and 100 millis.

I also added lodash as a dependency as it's a nice utility library, but I also have a branch (no-lodash) which achieves the same result without requiring an entire library for two function calls (_.isNumber and _.isString). I wasn't sure what your preference would be :-)

If you're not happy with the syntax for specifying a delay range, then that's entirely cool :-) (I can always tweak it :-) )