MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / findIndex

Method findIndex

modules/network/ble/btutils.js:415–427  ·  view source on GitHub ↗
(type, index = 0)

Source from the content-addressed store, hash-verified

413 return this.#getUUID16ListType(index);
414 }
415 findIndex(type, index = 0) {
416 const data = this.#data;
417 const length = data.byteLength;
418 while (index < length) {
419 const adLength = data[index]; ++index;
420 const adType = data[index]; ++index;
421 if (type == adType)
422 return index - 2;
423 else
424 index += adLength - 1;
425 }
426 return -1;
427 }
428 static serialize(obj) {
429 let parts = [];
430 for (let key in obj)

Callers 7

appearanceMethod · 0.95
completeNameMethod · 0.95
shortNameMethod · 0.95
manufacturerSpecificMethod · 0.95
flagsMethod · 0.95
completeUUID16ListMethod · 0.95
incompleteUUID16ListMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected