Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulf

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulf - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

test.html

5

lib/Document.js

@@ -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)

3

lib/EditableDocument.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc