@bayou/ot-common
Advanced tools
Comparing version 1.0.6 to 1.2.4
@@ -1,9 +0,9 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
// Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
import { IdSyntax } from '@bayou/config-common'; | ||
import { TFunction } from '@bayou/typecheck'; | ||
import { CommonBase } from '@bayou/util-common'; | ||
import AuthorId from './AuthorId'; | ||
import BaseDelta from './BaseDelta'; | ||
@@ -112,3 +112,3 @@ import RevisionNumber from './RevisionNumber'; | ||
*/ | ||
this._authorId = AuthorId.orNull(authorId); | ||
this._authorId = IdSyntax.checkAuthorIdOrNull(authorId); | ||
@@ -115,0 +115,0 @@ Object.freeze(this); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
103
BaseOp.js
@@ -1,7 +0,10 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
// Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
import { CommonBase, Functor } from '@bayou/util-common'; | ||
import { inspect } from 'util'; | ||
import { TBoolean, TString } from '@bayou/typecheck'; | ||
import { CommonBase, Errors, Functor } from '@bayou/util-common'; | ||
/** | ||
@@ -11,5 +14,83 @@ * Base class for OT operations. Instances of concrete subclasses of this class | ||
* BaseDelta} subclasses. | ||
* | ||
* **Note:** Each concrete subclass of this class needs to define a set of | ||
* static properties with names of the form `CODE_<name>`, each of which has a | ||
* string value. These values are collectively taken to be the acceptable opcode | ||
* names for use with the concrete subclass. | ||
*/ | ||
export default class BaseOp extends CommonBase { | ||
/** | ||
* Validates a {@link Functor} to be used as the payload for an instance of | ||
* this class. | ||
* | ||
* @param {Functor} payload The would-be payload for an instance. | ||
* @returns {Functor} `payload`, if it turns out to be valid. | ||
* @throws {Error} Thrown if `payload` is invalid. | ||
*/ | ||
static checkPayload(payload) { | ||
if (this.isValidPayload(payload)) { | ||
return payload; | ||
} | ||
throw Errors.badUse(`Invalid payload for ${this.name}: ${inspect(payload)}`); | ||
} | ||
/** | ||
* Indicates whether the given name is acceptable for use as an opcode name | ||
* on an instance of this class. | ||
* | ||
* **Note:** This depends on the set of `CODE_*` properties being correct for | ||
* the concrete subclass class. | ||
* | ||
* @param {string} name Potential opcode name. | ||
* @returns {boolean} `true` if `name` is valid for use as an opcode name on | ||
* this class, or `false` if not. | ||
*/ | ||
static isValidName(name) { | ||
TString.check(name); | ||
if (!this._names) { | ||
// First time this method has been called on the concrete subclass; | ||
// collect all the names. | ||
const names = new Set(); | ||
const descs = Object.getOwnPropertyDescriptors(this); | ||
for (const [propName, desc] of Object.entries(descs)) { | ||
if (!/^CODE_/.test(propName)) { | ||
continue; | ||
} | ||
const value = TString.nonEmpty(desc.get ? desc.get() : desc.value); | ||
names.add(value); | ||
if (names.size === 0) { | ||
throw new Errors.wtf(`No \`CODE_*\` properties found on ${this.name}.`); | ||
} | ||
} | ||
this._names = Object.freeze(names); | ||
} | ||
return this._names.has(name); | ||
} | ||
/** | ||
* Validates a {@link Functor} to be used as the payload for an instance of | ||
* this class, returning a `boolean` indicating validity. | ||
* | ||
* @param {Functor} payload The would-be payload for an instance. | ||
* @returns {boolean} `true` if `payload` is valid, or `false` if not. | ||
*/ | ||
static isValidPayload(payload) { | ||
if (!this.isValidName(payload.name)) { | ||
return false; | ||
} | ||
const result = this._impl_isValidPayload(payload); | ||
return TBoolean.check(result); | ||
} | ||
/** | ||
* Constructs an instance. This should not be used directly. Instead, use | ||
@@ -28,4 +109,8 @@ * the static constructor methods defined by concrete subclasses of this | ||
// Perform syntactic validation based on the concrete subclass. | ||
const payload = new Functor(name, ...args).withFrozenArgs(); | ||
this.constructor.checkPayload(payload); | ||
/** {Functor} The operation payload (name and arguments). */ | ||
this._payload = new Functor(name, ...args).withFrozenArgs(); | ||
this._payload = payload; | ||
@@ -70,2 +155,14 @@ Object.freeze(this); | ||
} | ||
/** | ||
* Main implementation of {@link #isValidPayload}. Subclasses must fill this | ||
* in. | ||
* | ||
* @abstract | ||
* @param {Functor} payload The would-be payload for an instance. | ||
* @returns {boolean} `true` if `payload` is valid, or `false` if not. | ||
*/ | ||
static _impl_isValidPayload(payload) { | ||
return this._mustOverride(payload); | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -256,2 +256,27 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
/** | ||
* Semantic validation for an OT change in the context of this snapshot. | ||
* Each subclass implements its own version of the semantic validation. | ||
* @param {BodyChange} change The change to apply. | ||
* @returns {boolean} `true` if valid change, otherwise throws and error. | ||
*/ | ||
validateChange(change) { | ||
this.constructor.changeClass.check(change); | ||
return this._impl_validateChange(change); | ||
} | ||
/** | ||
* The abstract implementation of {@link #validateChange}. This | ||
* class implements semantic validation for an OT change in the context | ||
* of this snapshot. Should be implemented by all subclasses. | ||
* @param {BodyChange} change The change to be validated in the context | ||
* of this snapshot. | ||
* @returns {boolean} `true` if valid change, otherwise throws and error. | ||
* @abstract | ||
*/ | ||
_impl_validateChange(change) { | ||
return this._mustOverride(change); | ||
} | ||
/** | ||
* Main implementation of {@link #diff}, as defined by the subclass. Takes a | ||
@@ -258,0 +283,0 @@ * snapshot of the same class, and produces a delta (not a change) |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -6,3 +6,2 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
import TheModule from './TheModule'; | ||
import AuthorId from './AuthorId'; | ||
import BaseChange from './BaseChange'; | ||
@@ -17,3 +16,2 @@ import BaseDelta from './BaseDelta'; | ||
TheModule, | ||
AuthorId, | ||
BaseChange, | ||
@@ -20,0 +18,0 @@ BaseDelta, |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -23,3 +23,3 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
static get NOT_DOCUMENT_OPS() { | ||
return [new MockOp('not_document')]; | ||
return [new MockOp('notDocument')]; | ||
} | ||
@@ -33,3 +33,3 @@ | ||
_impl_compose(other, wantDocument) { | ||
let resultName = wantDocument ? 'composed_doc' : 'composed_not_doc'; | ||
let resultName = wantDocument ? 'composedDoc' : 'composedNotDoc'; | ||
const op0 = this.ops[0]; | ||
@@ -49,3 +49,3 @@ | ||
return op0 ? (op0.name !== 'not_document') : true; | ||
return op0 ? (op0.name !== 'notDocument') : true; | ||
} | ||
@@ -52,0 +52,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -11,5 +11,21 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
export default class MockOp extends BaseOp { | ||
static get CODE_composedDoc() { return 'composedDoc'; } | ||
static get CODE_composedDoc_() { return 'composedDoc_'; } | ||
static get CODE_composedDoc__() { return 'composedDoc__'; } | ||
static get CODE_composedNotDoc() { return 'composedNotDoc'; } | ||
static get CODE_diffDelta() { return 'diffDelta'; } | ||
static get CODE_notDocument() { return 'notDocument'; } | ||
static get CODE_snap() { return 'snap'; } | ||
static get CODE_x() { return 'x'; } | ||
static get CODE_y() { return 'y'; } | ||
static get CODE_yes() { return 'yes'; } | ||
static get CODE_z() { return 'z'; } | ||
get name() { | ||
return this.payload.name; | ||
} | ||
static _impl_isValidPayload() { | ||
return true; | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -19,6 +19,25 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
// TODO: Fill in for testing purposes | ||
checkPathIs() { | ||
return true; | ||
} | ||
// TODO: Fill in for testing purposes | ||
checkPathAbsent() { | ||
return true; | ||
} | ||
// TODO: Fill in for testing purposes | ||
checkPathPresent() { | ||
return true; | ||
} | ||
_impl_diffAsDelta(newerSnapshot) { | ||
return [new MockOp('diff_delta'), newerSnapshot.contents.ops[0]]; | ||
return [new MockOp('diffDelta'), newerSnapshot.contents.ops[0]]; | ||
} | ||
_impl_validateChange() { | ||
return true; | ||
} | ||
static get _impl_changeClass() { | ||
@@ -25,0 +44,0 @@ return MockChange; |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -7,9 +7,9 @@ { | ||
"dependencies": { | ||
"@bayou/codec": "1.0.6", | ||
"@bayou/config-common": "1.0.6", | ||
"@bayou/typecheck": "1.0.6", | ||
"@bayou/util-common": "1.0.6" | ||
"@bayou/codec": "1.2.4", | ||
"@bayou/config-common": "1.2.4", | ||
"@bayou/typecheck": "1.2.4", | ||
"@bayou/util-common": "1.2.4" | ||
}, | ||
"name": "@bayou/ot-common", | ||
"version": "1.0.6" | ||
"version": "1.2.4" | ||
} |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -108,5 +108,5 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
test(['blort']); | ||
test(['blort', 1]); | ||
test(['blort', 1, 2, 3, 4, 'florp']); | ||
test(['z']); | ||
test(['z', 1]); | ||
test(['z', 1, 2, 3, 4, 'florp']); | ||
test(['x'], ['y'], ['z']); | ||
@@ -130,4 +130,4 @@ test(['x', ['a']], ['y', { b: 10 }], ['z', [[['pdq']]]]); | ||
test([], [['x']], false, [['composed_not_doc'], ['x']]); | ||
test([], [['x']], true, [['composed_doc'], ['x']]); | ||
test([], [['x']], false, [['composedNotDoc'], ['x']]); | ||
test([], [['x']], true, [['composedDoc'], ['x']]); | ||
}); | ||
@@ -163,3 +163,3 @@ | ||
it('should reject a non-document `this` when `wantDocument` is `true`', () => { | ||
const delta = new MockDelta([['not_document']]); | ||
const delta = new MockDelta([['notDocument']]); | ||
assert.throws(() => { delta.compose(MockDelta.EMPTY, true); }, /badUse/); | ||
@@ -171,3 +171,3 @@ }); | ||
it('should return a data value', () => { | ||
const delta = new MockDelta([['a', 1, 2, 3, [4, 5, 6]], ['b', { x: ['y'] }]]); | ||
const delta = new MockDelta([['x', 1, 2, 3, [4, 5, 6]], ['y', { x: ['y'] }]]); | ||
const result = delta.deconstruct(); | ||
@@ -179,3 +179,3 @@ | ||
it('should return an array of length one, which contains an array-of-arrays', () => { | ||
const delta = new MockDelta([['a', 1], ['b', [1, 2]]]); | ||
const delta = new MockDelta([['x', 1], ['y', [1, 2]]]); | ||
const result = delta.deconstruct(); | ||
@@ -240,4 +240,4 @@ | ||
it('should return `true` when equal ops are not also `===`', () => { | ||
const ops1 = [new MockOp('foo'), new MockOp('bar')]; | ||
const ops2 = [new MockOp('foo'), new MockOp('bar')]; | ||
const ops1 = [new MockOp('x'), new MockOp('y')]; | ||
const ops2 = [new MockOp('x'), new MockOp('y')]; | ||
const d1 = new MockDelta(ops1); | ||
@@ -251,4 +251,4 @@ const d2 = new MockDelta(ops2); | ||
it('should return `false` when array lengths differ', () => { | ||
const op1 = new MockOp('foo'); | ||
const op2 = new MockOp('bar'); | ||
const op1 = new MockOp('x'); | ||
const op2 = new MockOp('y'); | ||
const d1 = new MockDelta([op1]); | ||
@@ -270,7 +270,7 @@ const d2 = new MockDelta([op1, op2]); | ||
const op1 = new MockOp('foo'); | ||
const op2 = new MockOp('bar'); | ||
const op3 = new MockOp('baz'); | ||
const op4 = new MockOp('biff'); | ||
const op5 = new MockOp('quux'); | ||
const op1 = new MockOp('x'); | ||
const op2 = new MockOp('y'); | ||
const op3 = new MockOp('z'); | ||
const op4 = new MockOp('x', 1); | ||
const op5 = new MockOp('x', 2); | ||
@@ -277,0 +277,0 @@ test([op1], [op2]); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -16,8 +16,8 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
it('should accept a string `name argument', () => { | ||
const result = new MockOp('blort'); | ||
assert.strictEqual(result.payload.name, 'blort'); | ||
const result = new MockOp('x'); | ||
assert.strictEqual(result.payload.name, 'x'); | ||
}); | ||
it('should accept at least ten arguments after the name', () => { | ||
const result = new MockOp('blort', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); | ||
const result = new MockOp('x', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); | ||
assert.strictEqual(result.payload.args.length, 10); | ||
@@ -27,3 +27,3 @@ }); | ||
it('should produce a frozen instance with a frozen payload', () => { | ||
const op = new MockOp('blort'); | ||
const op = new MockOp('x'); | ||
assert.isFrozen(op); | ||
@@ -35,3 +35,3 @@ assert.isFrozen(op.payload); | ||
function test(...args) { | ||
const op = new MockOp('blort', ...args); | ||
const op = new MockOp('x', ...args); | ||
const gotArgs = op.payload.args; | ||
@@ -64,10 +64,17 @@ | ||
function test(...args) { | ||
assert.throws(() => new MockOp(...args)); | ||
assert.throws(() => new MockOp('x', ...args)); | ||
} | ||
test(new Map()); | ||
test(new Functor('x', 1, 2)); | ||
test([1, 2, new Set()], 3); | ||
test('foo', 3, [new Set()], 4); | ||
test(/blort/); | ||
test(() => 'woo'); | ||
test(1, 2, 3, new Map(), 4, 5, 6); | ||
// **TODO:** This should arguably fail, in that `Set` can't be | ||
// deep-frozen. The issue is probably that the `BaseOp` constructor | ||
// doesn't actually try to deep-freeze its arguments, just single-level | ||
// freeze. | ||
//test(new Functor('x', 1, 2, new Set())); | ||
}); | ||
@@ -98,3 +105,3 @@ | ||
it('should return an array data value', () => { | ||
const op = new MockOp('blort', ['florp', 'like'], { timeline: 'sideways' }); | ||
const op = new MockOp('x', ['florp', 'like'], { timeline: 'sideways' }); | ||
const result = op.deconstruct(); | ||
@@ -116,7 +123,7 @@ | ||
test('foo'); | ||
test('bar', 1, 2, 3); | ||
test('baz', ['florp', 'like']); | ||
test('goo', { timeline: 'sideways' }); | ||
test('boo', [[[[[[[[[['floomp']]]]]]]]]]); | ||
test('x'); | ||
test('y', 1, 2, 3); | ||
test('z', ['florp', 'like']); | ||
test('x', { timeline: 'sideways' }); | ||
test('y', [[[[[[[[[['floomp']]]]]]]]]]); | ||
}); | ||
@@ -139,5 +146,5 @@ }); | ||
test('x'); | ||
test('foo', 1); | ||
test('bar', ['x']); | ||
test('baz', { a: 10, b: 20 }); | ||
test('y', 1); | ||
test('z', ['x']); | ||
test('z', { a: 10, b: 20 }); | ||
}); | ||
@@ -144,0 +151,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -112,4 +112,4 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> | ||
it('should call through to the delta and wrap the result in a new instance', () => { | ||
const snap = new MockSnapshot(10, [new MockOp('some_op')]); | ||
const change = new MockChange(20, [new MockOp('change_op')]); | ||
const snap = new MockSnapshot(10, [new MockOp('x')]); | ||
const change = new MockChange(20, [new MockOp('y')]); | ||
const result = snap.compose(change); | ||
@@ -122,7 +122,7 @@ | ||
assert.deepEqual(result.contents.ops, | ||
[new MockOp('composed_doc'), new MockOp('change_op')]); | ||
[new MockOp('composedDoc'), new MockOp('y')]); | ||
}); | ||
it('should return `this` given a same-`revNum` empty-`delta` change', () => { | ||
const snap = new MockSnapshot(10, [new MockOp('some_op')]); | ||
const snap = new MockSnapshot(10, [new MockOp('x')]); | ||
const change = new MockChange(10, []); | ||
@@ -163,5 +163,5 @@ const result = snap.compose(change); | ||
it('should call through to the delta and wrap the result in a new instance', () => { | ||
const snap = new MockSnapshot(10, [new MockOp('some_op')]); | ||
const change1 = new MockChange(21, [new MockOp('change_op1')]); | ||
const change2 = new MockChange(22, [new MockOp('change_op2')]); | ||
const snap = new MockSnapshot(10, [new MockOp('x')]); | ||
const change1 = new MockChange(21, [new MockOp('y')]); | ||
const change2 = new MockChange(22, [new MockOp('z')]); | ||
const result = snap.composeAll([change1, change2]); | ||
@@ -174,7 +174,7 @@ | ||
assert.deepEqual(result.contents.ops, | ||
[new MockOp('composed_doc_'), new MockOp('change_op2')]); | ||
[new MockOp('composedDoc_'), new MockOp('z')]); | ||
}); | ||
it('should return `this` given same-`revNum` empty-`delta` changes', () => { | ||
const snap = new MockSnapshot(10, [new MockOp('some_op')]); | ||
const snap = new MockSnapshot(10, [new MockOp('x')]); | ||
const change = new MockChange(10, []); | ||
@@ -222,3 +222,3 @@ const result = snap.composeAll([change, change, change, change]); | ||
const oldSnap = new MockSnapshot(10, []); | ||
const newSnap = new MockSnapshot(20, [new MockOp('new_snap')]); | ||
const newSnap = new MockSnapshot(20, [new MockOp('x')]); | ||
const result = oldSnap.diff(newSnap); | ||
@@ -233,3 +233,3 @@ | ||
assert.deepEqual(result.delta.ops, | ||
[new MockOp('diff_delta'), new MockOp('new_snap')]); | ||
[new MockOp('diffDelta'), new MockOp('x')]); | ||
}); | ||
@@ -245,4 +245,4 @@ | ||
const snap1 = new MockSnapshot(10, [new MockOp('some_op')]); | ||
const snap2 = new MockSnapshot(20, [new MockOp('some_op')]); | ||
const snap1 = new MockSnapshot(10, [new MockOp('x')]); | ||
const snap2 = new MockSnapshot(20, [new MockOp('x')]); | ||
const snap3 = new MockSnapshot(30, snap2.contents); | ||
@@ -359,4 +359,4 @@ | ||
it('should return an appropriately-constructed instance given a different `contents`', () => { | ||
const delta = new MockDelta([new MockOp('yo')]); | ||
const snap = new MockSnapshot(123, [new MockOp('hello')]); | ||
const delta = new MockDelta([new MockOp('x')]); | ||
const snap = new MockSnapshot(123, [new MockOp('y')]); | ||
const result = snap.withContents(delta); | ||
@@ -363,0 +363,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
@@ -1,2 +0,2 @@ | ||
// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia). | ||
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia). | ||
// Licensed AS IS and WITHOUT WARRANTY under the Apache License, | ||
@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0> |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
91982
2510
1
5
22
+ Added@bayou/codec@1.2.4(transitive)
+ Added@bayou/config-common@1.2.4(transitive)
+ Added@bayou/injecty@1.2.4(transitive)
+ Added@bayou/see-all@1.2.4(transitive)
+ Added@bayou/typecheck@1.2.4(transitive)
+ Added@bayou/util-common@1.2.4(transitive)
+ Added@bayou/util-core@1.2.4(transitive)
- Removed@bayou/codec@1.0.6(transitive)
- Removed@bayou/config-common@1.0.6(transitive)
- Removed@bayou/injecty@1.0.6(transitive)
- Removed@bayou/typecheck@1.0.6(transitive)
- Removed@bayou/util-common@1.0.6(transitive)
- Removed@bayou/util-core@1.0.6(transitive)
Updated@bayou/codec@1.2.4
Updated@bayou/config-common@1.2.4
Updated@bayou/typecheck@1.2.4
Updated@bayou/util-common@1.2.4