From ff2a6e61d4c7072db9e49c2dee2b34bcc2bb4c43 Mon Sep 17 00:00:00 2001 From: HauptmannEck Date: Tue, 21 Mar 2017 11:29:02 -0500 Subject: [PATCH] (#46) - Add the id on the return of the `updated:false` response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …to align with the docs and the `updated:true` flow. fixes #46 --- dist/pouchdb.upsert.js | 2 +- dist/pouchdb.upsert.min.js | 2 +- index.js | 2 +- test/test.js | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/pouchdb.upsert.js b/dist/pouchdb.upsert.js index 56d1dcc..b4917f0 100644 --- a/dist/pouchdb.upsert.js +++ b/dist/pouchdb.upsert.js @@ -25,7 +25,7 @@ function upsertInner(db, docId, diffFun) { if (!newDoc) { // if the diffFun returns falsy, we short-circuit as // an optimization - return { updated: false, rev: docRev }; + return { updated: false, rev: docRev, id: docId }; } // users aren't allowed to modify these values, diff --git a/dist/pouchdb.upsert.min.js b/dist/pouchdb.upsert.min.js index 01bb807..c4443d6 100644 --- a/dist/pouchdb.upsert.min.js +++ b/dist/pouchdb.upsert.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.PouchUpsert=e()}}(function(){return function e(t,n,r){function o(u,c){if(!n[u]){if(!t[u]){var f="function"==typeof require&&require;if(!c&&f)return f(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var a=n[u]={exports:{}};t[u][0].call(a.exports,function(e){var n=t[u][1][e];return o(n?n:e)},a,a.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u