MCPcopy Create free account
hub / github.com/angular/dev-infra / fill

Function fill

github-actions/browserstack/set-browserstack-env.js:12225–12249  ·  view source on GitHub ↗
(headers, object)

Source from the content-addressed store, hash-verified

12223 if (offset == null || offset === maxInt) {
12224 hostnameRecords.offset = 0;
12225 affinity = 4;
12226 } else {
12227 hostnameRecords.offset++;
12228 affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4;
12229 }
12230 }
12231 if (records[affinity] != null && records[affinity].ips.length > 0) {
12232 family = records[affinity];
12233 } else {
12234 family = records[affinity === 4 ? 6 : 4];
12235 }
12236 } else {
12237 family = records[affinity];
12238 }
12239 if (family == null || family.ips.length === 0) {
12240 return ip;
12241 }
12242 if (family.offset == null || family.offset === maxInt) {
12243 family.offset = 0;
12244 } else {
12245 family.offset++;
12246 }
12247 const position = family.offset % family.ips.length;
12248 ip = (_a = family.ips[position]) != null ? _a : null;
12249 if (ip == null) {
12250 return ip;
12251 }
12252 if (Date.now() - ip.timestamp > ip.ttl) {

Callers 2

constructorMethod · 0.70
initializeResponseFunction · 0.70

Calls 2

appendHeaderFunction · 0.70
keysMethod · 0.45

Tested by

no test coverage detected