This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Description
|
isEqual: function(a, b) { |
|
// TODO: Special-case arraybuffers, etc |
|
if (a === undefined || b === undefined) { |
|
return false; |
|
} |
|
a = util.toString(a); |
|
b = util.toString(b); |
|
var maxLength = Math.max(a.length, b.length); |
|
if (maxLength < 5) { |
|
throw new Error("a/b compare too short"); |
|
} |
|
return a.substring(0, Math.min(maxLength, a.length)) == b.substring(0, Math.min(maxLength, b.length)); |
|
} |
I think someone tried here to implement a prefix match, but it should not work, because it's the same as
return a.substring(0, a.length) == b.substring(0, b.length);
Am I right, or did I overlook something? Are you interested in a pr?