a glob matcher in javascript