浏览代码

Renamed utils.compareArrays.SUFFIX to utils.compareArrays.EXTENSION.

Piotr Jasiun 10 年之前
父节点
当前提交
434152105d
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 4 4
      packages/ckeditor5-utils/src/utils.js
  2. 2 2
      packages/ckeditor5-utils/tests/utils/utils.js

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

@@ -61,14 +61,14 @@ CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], function( lod
 		 *
 		 *   compareArrays( [ 0, 2 ], [ 0, 2 ] ); // SAME
 		 *   compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // PREFIX
-		 *   compareArrays( [ 0, 2 ], [ 0 ] ); // SUFFIX
+		 *   compareArrays( [ 0, 2 ], [ 0 ] ); // EXTENSION
 		 *   compareArrays( [ 0, 2 ], [ 1, 2 ] ); // DIFFERENT
 		 *
 		 * @param {Array} a Array that is compared.
 		 * @param {Array} b Array to compare with.
 		 * @returns {Number} How array `a` is related to array `b`. Represented by one of flags:
 		 * `a` is {@link utils.compareArrays#SAME same}, `a` is a {@link utils.compareArrays#PREFIX prefix),
-		 * `a` is a {@link utils.compareArrays#SUFFIX suffix}, or `a` is {@link utils.compareArrays#DIFFERENT different}.
+		 * `a` is a {@link utils.compareArrays#EXTENSION extension}, or `a` is {@link utils.compareArrays#DIFFERENT different}.
 		 */
 		compareArrays( a, b ) {
 			var minLen = Math.min( a.length, b.length );
@@ -89,7 +89,7 @@ CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], function( lod
 				return utils.compareArrays.PREFIX;
 			} else {
 				// Compared array is longer so it is a suffix of the other array.
-				return utils.compareArrays.SUFFIX;
+				return utils.compareArrays.EXTENSION;
 			}
 		}
 	};
@@ -111,7 +111,7 @@ CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], function( lod
 	 *
 	 * @type {number}
 	 */
-	utils.compareArrays.SUFFIX = 2;
+	utils.compareArrays.EXTENSION = 2;
 	/**
 	 * Flag for "is different than" relation between arrays.
 	 *

+ 2 - 2
packages/ckeditor5-utils/tests/utils/utils.js

@@ -131,13 +131,13 @@ describe( 'utils', function() {
 			expect( result ).to.equal( utils.compareArrays.PREFIX );
 		} );
 
-		it( 'should return SUFFIX flag, when n first elements of first array are same as all elements of the second array', function() {
+		it( 'should return EXTENSION flag, when n first elements of first array are same as all elements of the second array', function() {
 			var a = [ 'abc', 0, 3 ];
 			var b = [ 'abc', 0 ];
 
 			var result = utils.compareArrays( a, b );
 
-			expect( result ).to.equal( utils.compareArrays.SUFFIX );
+			expect( result ).to.equal( utils.compareArrays.EXTENSION );
 		} );
 
 		it( 'should return DIFFERENT flag, when arrays are not same', function() {