File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 3
3
var utils = require ( './pouch-utils' ) ;
4
4
var wrappers = require ( 'pouchdb-wrappers' ) ;
5
5
6
- function isUntransformable ( doc ) {
6
+ function isUntransformable ( doc , config ) {
7
7
var isLocal = typeof doc . _id === 'string' && utils . isLocalId ( doc . _id ) ;
8
- return isLocal || doc . _deleted ;
8
+ return isLocal || doc . _deleted ? ! config . handleDeleted : false ;
9
9
}
10
10
11
11
// api.filter provided for backwards compat with the old "filter-pouch"
12
12
exports . transform = exports . filter = function transform ( config ) {
13
13
var db = this ;
14
14
15
15
var incoming = function ( doc ) {
16
- if ( ! isUntransformable ( doc ) && config . incoming ) {
16
+ if ( ! isUntransformable ( doc , config ) && config . incoming ) {
17
17
return config . incoming ( utils . clone ( doc ) ) ;
18
18
}
19
19
return doc ;
20
20
} ;
21
21
var outgoing = function ( doc ) {
22
- if ( ! isUntransformable ( doc ) && config . outgoing ) {
22
+ if ( ! isUntransformable ( doc , config ) && config . outgoing ) {
23
23
return config . outgoing ( utils . clone ( doc ) ) ;
24
24
}
25
25
return doc ;
You can’t perform that action at this time.
0 commit comments