Comparing version 4.1.0 to 4.1.1
@@ -18,2 +18,3 @@ /** | ||
*/ | ||
var debug = require('debug')('gulf') | ||
var Link = require('./Link') | ||
@@ -271,3 +272,3 @@ , Edit = require('./Edit') | ||
Document.prototype.receiveEdit = function(edit, author, fromLink, callback) { | ||
console.log('receiveEdit', edit) | ||
debug('receiveEdit', edit) | ||
edit = Edit.unpack(edit, this.ottype) | ||
@@ -445,3 +446,3 @@ if (!this.master || fromLink === this.master) { | ||
// apply changes | ||
console.log('Document: apply edit', edit) | ||
debug('Document: apply edit', edit) | ||
try { | ||
@@ -448,0 +449,0 @@ this.content = edit.apply(this.content) |
@@ -18,2 +18,3 @@ /** | ||
*/ | ||
var debug = require('debug')('gulf') | ||
var Document = require('./Document') | ||
@@ -98,3 +99,3 @@ , Edit = require('./Edit') | ||
// apply changes | ||
console.log('EditableDocument: apply edit', edit, ownEdit) | ||
debug('EditableDocument: apply edit', edit, ownEdit) | ||
try { | ||
@@ -101,0 +102,0 @@ this.content = edit.apply(this.content) |
@@ -19,2 +19,3 @@ /** | ||
var Duplex = require('stream').Duplex | ||
var debug = require('debug')('gulf') | ||
require('setimmediate') | ||
@@ -43,7 +44,7 @@ var SECONDS = 1000 | ||
this.on('error', function(er) { | ||
console.warn('Error in link', 'undefined'!=typeof window? er : er.stack || er) | ||
debug('Error in link', 'undefined'!=typeof window? er : er.stack || er) | ||
}.bind(this)) | ||
this.on('editError', function(er) { | ||
console.warn('EditError in link', 'undefined'!=typeof window? er : er.stack || er) | ||
debug('EditError in link', 'undefined'!=typeof window? er : er.stack || er) | ||
}) | ||
@@ -94,3 +95,3 @@ | ||
var data = JSON.stringify(msg) | ||
console.log('->', data) | ||
debug('->', data) | ||
this.push(data) | ||
@@ -159,3 +160,3 @@ }.bind(this)) | ||
Link.prototype._write = function(buf, enc, cb) { | ||
console.log('<- _write:', buf.toString()) | ||
debug('<- _write:', buf.toString()) | ||
var args = JSON.parse(buf.toString()) | ||
@@ -162,0 +163,0 @@ |
{ | ||
"name": "gulf", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "transport-agnostic operational transformation control layer", | ||
@@ -10,2 +10,3 @@ "repository": { | ||
"dependencies": { | ||
"debug": "^2.2", | ||
"setimmediate": "1.x", | ||
@@ -26,10 +27,12 @@ "queue": "3.x" | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "mocha", | ||
"build": "browserify test/tests.js > tests.brwsr.js" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*", | ||
"mocha": "3.x", | ||
"expect.js": "*", | ||
"ottypes": "*", | ||
"mux-dmx": "*", | ||
"through2": "*" | ||
"through2": "*", | ||
"browserify": "*" | ||
}, | ||
@@ -36,0 +39,0 @@ "author": "Marcel Klehr <mklehr@gmx.net>", |
@@ -375,6 +375,17 @@ # Gulf [![Build Status](https://travis-ci.org/marcelklehr/gulf.png)](https://travis-ci.org/marcelklehr/gulf) | ||
## Tests? | ||
### Node.js | ||
To run the tests in node, run the following after installing the devDependencies: | ||
``` | ||
> mocha | ||
npm test | ||
``` | ||
### Browser | ||
To run the tests in the browser, browserify gulf: | ||
``` | ||
npm run build | ||
``` | ||
and open `test.html` in the browser of your choice. | ||
## License | ||
@@ -381,0 +392,0 @@ (c) 2013-2016 by Marcel Klehr |
@@ -9,3 +9,4 @@ /* global describe, xdescribe, it, xit */ | ||
try { | ||
gulf = require('gulf') | ||
gulf = 'gulf' | ||
gulf = require(gulf) | ||
}catch(e) { | ||
@@ -341,6 +342,6 @@ console.log(e) | ||
linkA.pipe(linkB).pipe(linkA) | ||
setImmediate(function() { | ||
setTimeout(function() { | ||
docB.update([3,'d']) | ||
}) | ||
}, 100) | ||
@@ -350,3 +351,3 @@ setTimeout(function() { | ||
done() | ||
}, 100) | ||
}, 200) | ||
}) | ||
@@ -356,2 +357,4 @@ }) | ||
describe('Linking documents in parallel environments', function() { | ||
if (process.browser) return this.skip() | ||
var initialContent = 'abc' | ||
@@ -358,0 +361,0 @@ var master, docA, docB |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances 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
529855
16
13898
424
3
6
12
5
+ Addeddebug@^2.2
+ Addeddebug@2.6.9(transitive)
+ Addedms@2.0.0(transitive)