MCPcopy Index your code
hub / github.com/UI5/webcomponents / fromList

Function fromList

packages/main/test/pages/diffable-html.js:6963–6978  ·  view source on GitHub ↗
(n, state)

Source from the content-addressed store, hash-verified

6961 // This function is designed to be inlinable, so please take care when making
6962 // changes to the function body.
6963 function fromList(n, state) {
6964 // nothing buffered
6965 if (state.length === 0) return null;
6966
6967 var ret;
6968 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
6969 // read it all, truncate the list
6970 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
6971 state.buffer.clear();
6972 } else {
6973 // read part of list
6974 ret = fromListPartial(n, state.buffer, state.decoder);
6975 }
6976
6977 return ret;
6978 }
6979
6980 // Extracts only enough buffered data to satisfy the amount requested.
6981 // This function is designed to be inlinable, so please take care when making

Callers 1

diffable-html.jsFile · 0.85

Calls 2

fromListPartialFunction · 0.85
shiftMethod · 0.80

Tested by

no test coverage detected