This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solves the intersection for a single component | |
// Reference: http://stackoverflow.com/questions/2821506/how-do-you-tell-if-two-wildcards-overlap | |
function innersect(w1, w2) { | |
// both are either empty or contain a wildcard | |
if ((w1 === "" || w1 === "*") && | |
(w2 === "" || w2 === "*")) return true; | |
// only one of them is empty, the other is not just a wildcard | |
if (w1 === "" || w2 === "") return false; | |
var c1 = w1[0], c2 = w2[0]; | |
var remain1 = w1.slice(1), remain2 = w2.slice(1); |
OlderNewer