A simple pattern matcher for js objects