its actually a single quick regex check  https://github.com/stefanpenner/leaf/blob/master/lib/leaf.js#L3 https://github.com/stefanpenner/leaf/blob/master/lib/leaf.js#L30-L32