MCPcopy Index your code
hub / github.com/deployd/deployd / getView

Function getView

test-app/public/sinon.js:16711–16727  ·  view source on GitHub ↗

* Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view.

(start, end, transforms)

Source from the content-addressed store, hash-verified

16709 * positions of the view.
16710 */
16711 function getView(start, end, transforms) {
16712 var index = -1,
16713 length = transforms.length;
16714
16715 while (++index < length) {
16716 var data = transforms[index],
16717 size = data.size;
16718
16719 switch (data.type) {
16720 case 'drop': start += size; break;
16721 case 'dropRight': end -= size; break;
16722 case 'take': end = nativeMin(end, start + size); break;
16723 case 'takeRight': start = nativeMax(start, end - size); break;
16724 }
16725 }
16726 return { 'start': start, 'end': end };
16727 }
16728
16729 /**
16730 * Extracts wrapper details from the `source` body comment.

Callers 1

lazyValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected