1 /* Built-in method references for those with the same name as other `lodash` methods. */
2 var nativeMax = Math.max,
6 * Gets the view, applying any `transforms` to the `start` and `end` positions.
9 * @param {number} start The start of the view.
10 * @param {number} end The end of the view.
11 * @param {Array} transforms The transformations to apply to the view.
12 * @returns {Object} Returns an object containing the `start` and `end`
13 * positions of the view.
15 function getView(start, end, transforms) {
17 length = transforms.length;
19 while (++index < length) {
20 var data = transforms[index],
24 case 'drop': start += size; break;
25 case 'dropRight': end -= size; break;
26 case 'take': end = nativeMin(end, start + size); break;
27 case 'takeRight': start = nativeMax(start, end - size); break;
30 return { 'start': start, 'end': end };
33 module.exports = getView;