MCPcopy Index your code
hub / github.com/nodejs/node / isPartialUint8Array

Function isPartialUint8Array

lib/internal/util/comparisons.js:155–172  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

153}
154
155function isPartialUint8Array(a, b) {
156 const lenA = getByteLength(a);
157 const lenB = getByteLength(b);
158 if (lenA < lenB) {
159 return false;
160 }
161 let offsetA = 0;
162 for (let offsetB = 0; offsetB < lenB; offsetB++) {
163 while (a[offsetA] !== b[offsetB]) {
164 offsetA++;
165 if (offsetA > lenA - lenB + offsetB) {
166 return false;
167 }
168 }
169 offsetA++;
170 }
171 return true;
172}
173
174function isPartialArrayBufferView(a, b) {
175 if (a.byteLength < b.byteLength) {

Callers 2

isPartialArrayBufferViewFunction · 0.85
objectComparisonStartFunction · 0.85

Calls 1

getByteLengthFunction · 0.50

Tested by

no test coverage detected