8
0
Просмотр исходного кода

Change: Export functions in operation/transform.js as separate functions, not an object.

Szymon Cofalik 7 лет назад
Родитель
Сommit
d092fc795f

+ 2 - 7
packages/ckeditor5-engine/src/model/operation/transform.js

@@ -50,7 +50,7 @@ function updateBaseVersions( operations, baseVersion ) {
 	return operations;
 }
 
-function transform( a, b, context = {} ) {
+export function transform( a, b, context = {} ) {
 	const transformationFunction = getTransformation( a, b );
 
 	try {
@@ -69,7 +69,7 @@ function transform( a, b, context = {} ) {
 	}
 }
 
-function transformSets( operationsA, operationsB, options ) {
+export function transformSets( operationsA, operationsB, options ) {
 	operationsA = operationsA.slice();
 	operationsB = operationsB.slice();
 
@@ -163,11 +163,6 @@ function transformSets( operationsA, operationsB, options ) {
 	return { operationsA, operationsB };
 }
 
-export default {
-	transform,
-	transformSets
-};
-
 function padWithNoOps( operations, howMany ) {
 	for ( let i = 0; i < howMany; i++ ) {
 		operations.push( new NoOperation( 0 ) );

Разница между файлами не показана из-за своего большого размера
+ 112 - 112
packages/ckeditor5-engine/tests/model/operation/transform.js


+ 3 - 3
packages/ckeditor5-engine/tests/model/operation/transform/utils.js

@@ -7,7 +7,7 @@ import UndoEditing from '@ckeditor/ckeditor5-undo/src/undoediting';
 import BlockQuoteEditing from '@ckeditor/ckeditor5-block-quote/src/blockquoteediting';
 
 import { getData, parse } from '../../../../src/dev-utils/model';
-import transform from '../../../../src/model/operation/transform';
+import { transformSets } from '../../../../src/model/operation/transform';
 import Position from '../../../../src/model/position';
 import Range from '../../../../src/model/range';
 import OperationFactory from '../../../../src/model/operation/operationfactory';
@@ -290,9 +290,9 @@ export function syncClients() {
 			};
 
 			if ( localClient.orderNumber < remoteClient.orderNumber ) {
-				remoteOperationsTransformed = transform.transformSets( localOperations, remoteOperations, options ).operationsB;
+				remoteOperationsTransformed = transformSets( localOperations, remoteOperations, options ).operationsB;
 			} else {
-				remoteOperationsTransformed = transform.transformSets( remoteOperations, localOperations, options ).operationsA;
+				remoteOperationsTransformed = transformSets( remoteOperations, localOperations, options ).operationsA;
 			}
 
 			localClient.editor.model.enqueueChange( 'transparent', writer => {

Некоторые файлы не были показаны из-за большого количества измененных файлов