Rebased and made a PR for ya: https://github.com/nickcolley/pouchdb/pull/1