Bladeren bron

Renamed `PREFIX` and `EXTENSION` to lower case.

Oskar Wrobel 9 jaren geleden
bovenliggende
commit
44068348bd
2 gewijzigde bestanden met toevoegingen van 8 en 8 verwijderingen
  1. 4 4
      packages/ckeditor5-utils/src/comparearrays.js
  2. 4 4
      packages/ckeditor5-utils/tests/comparearrays.js

+ 4 - 4
packages/ckeditor5-utils/src/comparearrays.js

@@ -12,8 +12,8 @@
  * it means that arrays differ.
  *
  *		compareArrays( [ 0, 2 ], [ 0, 2 ] );		// 'SAME'
- *		compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );		// 'PREFIX'
- *		compareArrays( [ 0, 2 ], [ 0 ] );			// 'EXTENSION'
+ *		compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );		// 'prefix'
+ *		compareArrays( [ 0, 2 ], [ 0 ] );			// 'extension'
  *		compareArrays( [ 0, 2 ], [ 1, 2 ] );		// 0
  *		compareArrays( [ 0, 2 ], [ 0, 1 ] );		// 1
  *
@@ -38,9 +38,9 @@ export default function compareArrays( a, b ) {
 		return 'SAME';
 	} else if ( a.length < b.length ) {
 		// Compared array is shorter so it is a prefix of the other array.
-		return 'PREFIX';
+		return 'prefix';
 	} else {
 		// Compared array is longer so it is an extension of the other array.
-		return 'EXTENSION';
+		return 'extension';
 	}
 }

+ 4 - 4
packages/ckeditor5-utils/tests/comparearrays.js

@@ -18,22 +18,22 @@ describe( 'utils', () => {
 			expect( result ).to.equal( 'SAME' );
 		} );
 
-		it( 'should return PREFIX flag, when all n elements of first array are same as n first elements of the second array', () => {
+		it( 'should return prefix flag, when all n elements of first array are same as n first elements of the second array', () => {
 			let a = [ 'abc', 0 ];
 			let b = [ 'abc', 0, 3 ];
 
 			let result = compareArrays( a, b );
 
-			expect( result ).to.equal( 'PREFIX' );
+			expect( result ).to.equal( 'prefix' );
 		} );
 
-		it( 'should return EXTENSION flag, when n first elements of first array are same as all elements of the second array', () => {
+		it( 'should return extension flag, when n first elements of first array are same as all elements of the second array', () => {
 			let a = [ 'abc', 0, 3 ];
 			let b = [ 'abc', 0 ];
 
 			let result = compareArrays( a, b );
 
-			expect( result ).to.equal( 'EXTENSION' );
+			expect( result ).to.equal( 'extension' );
 		} );
 
 		it( 'should return index on which arrays differ, when arrays are not the same', () => {