MCPcopy
hub / github.com/ThatGuySam/doesitarm / eitherMatches

Function eitherMatches

helpers/matching.js:17–43  ·  view source on GitHub ↗
(stringARaw, stringBRaw)

Source from the content-addressed store, hash-verified

15}
16
17export function eitherMatches (stringARaw, stringBRaw) {
18 // Make strings lowercase for more generous comparison
19 const stringA = stringARaw.toLowerCase()
20 const stringB = stringBRaw.toLowerCase()
21
22 const stringALength = stringA.length
23 const stringBLength = stringB.length
24
25 // If string lengths are equal
26 // then just compare the equality of the strings
27 if (stringALength === stringBLength) {
28 // console.log('Strings are equal length', stringA, stringB)
29 return (stringA === stringB)
30 }
31
32 // If string A is larger
33 // then find string B within it
34 if (stringALength > stringBLength) {
35 // console.log('String A is bigger', stringA, stringB)
36 return matchesWholeWord( stringB, stringA )
37 }
38
39 // If string B is larger
40 // then find string A within it
41 // console.log('String B is bigger', stringA, stringB)
42 return matchesWholeWord( stringA, stringB )
43}

Callers 2

buildReadmeAppListFunction · 0.90
index.test.jsFile · 0.90

Calls 1

matchesWholeWordFunction · 0.85

Tested by

no test coverage detected