UNPKG

falcor-router

Version:

A router DataSource constructor for falcor that allows you to model all your cloud data sources as a single JSON resource.

15 lines (13 loc) 312 B
/** * takes in a range and normalizes it to have a to / from */ module.exports = function normalize(range) { var from = range.from || 0; var to; if (typeof range.to === 'number') { to = range.to; } else { to = from + range.length - 1; } return {to: to, from: from}; };