UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

28 lines (20 loc) 520 B
var countSteps = require('../math/countSteps'); /** * Returns an Array of numbers inside range. */ function range(start, stop, step) { if (stop == null) { stop = start; start = 0; } step = step || 1; var result = [], nSteps = countSteps(stop - start, step), i = start; while (i <= stop) { result.push(i); i += step; } return result; } module.exports = range;