MCPcopy Index your code
hub / github.com/devcontainers/cli / arrayStartsWithArray

Function arrayStartsWithArray

src/test/cli.build.test.ts:116–126  ·  view source on GitHub ↗
(subject: string[], startsWith: string[])

Source from the content-addressed store, hash-verified

114 const buildWithoutCacheCommand = `${commandBase} --image-name ${nonCachedImageName} --no-cache`;
115
116 function arrayStartsWithArray(subject: string[], startsWith: string[]) {
117 if (subject.length < startsWith.length) {
118 return false;
119 }
120 for (let i = 0; i < startsWith.length; i++) {
121 if (subject[i] !== startsWith[i]) {
122 return false;
123 }
124 }
125 return true;
126 }
127
128 function haveCommonEntries(arr1: string[], arr2: string[]) {
129 return arr1.every(item => arr2.includes(item));

Callers 1

cli.build.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected