44 lines
950 B
JavaScript
44 lines
950 B
JavaScript
// Metro module 5102 (f5103).
|
|
module.exports = function fuzzysearch(a0, a1) {
|
|
const length2 = a1.length;
|
|
const length = a0.length;
|
|
if (length > length2) {
|
|
return false;
|
|
}
|
|
if (length === length2) {
|
|
return a0 === a1;
|
|
}
|
|
L8: {
|
|
let r3 = 0;
|
|
const r6 = 0 < length;
|
|
let r4 = 0;
|
|
if (r6) {
|
|
loop3: while (true) {
|
|
const r13 = a0.charCodeAt(r3);
|
|
let r0 = r4;
|
|
const r5 = r3;
|
|
if (r0 < length2) {
|
|
while (true) {
|
|
const charCodeAt = a1.charCodeAt;
|
|
const r1 = r0 + 1;
|
|
if (charCodeAt.call(a1, r0) === r13) {
|
|
r3 = r5 + 1;
|
|
r4 = r1;
|
|
if (r3 < length) {
|
|
continue loop3;
|
|
}
|
|
break L8;
|
|
}
|
|
r0 = r1;
|
|
if (!(r0 < length2)) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
};
|