sharedb-hooks
Advanced tools
Comparing version 3.0.3 to 3.0.4
22
index.js
@@ -5,2 +5,15 @@ var _ = require('lodash') | ||
backend.onQuery = onQuery.bind(backend); | ||
backend.use('apply', function(shareRequest, done) { | ||
console.log('apply', shareRequest.snapshot) | ||
const opData = shareRequest.op | ||
const snapshot = shareRequest.snapshot | ||
if (!opData.create && !shareRequest.originalSnapshot){ | ||
shareRequest.originalSnapshot = _.cloneDeep(snapshot) | ||
} | ||
done() | ||
}) | ||
}; | ||
@@ -24,12 +37,3 @@ | ||
}); | ||
backend.use('apply', function(shareRequest, done) { | ||
const opData = shareRequest.op | ||
const snapshot = shareRequest.snapshot | ||
if (!opData.create && !shareRequest.originalSnapshot){ | ||
shareRequest.originalSnapshot = _.cloneDeep(snapshot) | ||
} | ||
done() | ||
}) | ||
} | ||
@@ -36,0 +40,0 @@ |
{ | ||
"name": "sharedb-hooks", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "ShareDb hooks", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5239
102