浏览代码

Removed methods from utils which are not in use by CKEditor code.

fredck 11 年之前
父节点
当前提交
aab7ba96e9

+ 1 - 1
packages/ckeditor5-utils/src/lib/lodash/lodash-ckeditor.js

@@ -1,7 +1,7 @@
 /**
  * @license
  * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
- * Build: `lodash modern exports="amd" include="extend,isFunction" --debug --output src/lib/lodash/lodash-ckeditor.js`
+ * Build: `lodash modern exports="amd" include="extend" --debug --output src/lib/lodash/lodash-ckeditor.js`
  * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
  * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
  * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors

+ 1 - 14
packages/ckeditor5-utils/src/utils-lodash.js

@@ -31,20 +31,7 @@
 		 * @param {*} thisArg The this binding of callback.
 		 * @returns {Object} The destination object.
 		 */
-		'extend',
-
-		/**
-		 * Checks if value is a function.
-		 *
-		 * From Lo-Dash: https://lodash.com/docs#isFunction
-		 *
-		 * @member utils
-		 * @method extend
-		 *
-		 * @param {*} value The value to check.
-		 * @returns {Boolean} `true` if the value is a function, else `false`.
-		 */
-		'isFunction'
+		'extend'
 	];
 
 	// Make this compatible with CommonJS as well so it can be used in Node (e.g. "grunt lodash").

+ 1 - 12
packages/ckeditor5-utils/src/utils.js

@@ -17,18 +17,7 @@ CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], function( lod
 		/**
 		 * The list of methods defined in `utils` that come from lodash.
 		 */
-		_lodashIncludes: lodashIncludes,
-
-		/**
-		 * Checks if the provided object is a "pure" JavaScript object. In other words, if it is not any other
-		 * JavaScript native type, like Number or String.
-		 *
-		 * @param obj The object to be checked.
-		 * @returns {Boolean} `true` if the provided object is a "pure" JavaScript object. Otherwise `false`.
-		 */
-		isObject: function( obj ) {
-			return typeof obj === 'object' && !!obj;
-		}
+		_lodashIncludes: lodashIncludes
 	};
 
 	// Extend "utils" with Lo-Dash methods.

+ 0 - 46
packages/ckeditor5-utils/tests/utils/utils.js

@@ -96,49 +96,3 @@ describe( 'extend()', function() {
 		expect( target ).to.have.property( 'd' ).to.equal( 2 );
 	} );
 } );
-
-describe( 'isFunction()', function() {
-	it( 'should be true for functions only', function() {
-		var utils = modules.utils;
-
-		var f1 = function() {};
-
-		/* jshint -W054 */ // The Function constructor is a form of eval
-		var f2 = new Function( '' );
-		/* jshint +W054 */
-
-		expect( utils.isFunction( f1 ) ).to.be.true();
-		expect( utils.isFunction( f2 ) ).to.be.true();
-
-		expect( utils.isFunction( 1 ) ).to.be.false();
-		expect( utils.isFunction( 'a' ) ).to.be.false();
-		expect( utils.isFunction( true ) ).to.be.false();
-		expect( utils.isFunction( undefined ) ).to.be.false();
-		expect( utils.isFunction( [] ) ).to.be.false();
-		expect( utils.isFunction( {} ) ).to.be.false();
-		expect( utils.isFunction( new Date() ) ).to.be.false();
-	} );
-} );
-
-describe( 'isObject()', function() {
-	it( 'should be true for pure objects only', function() {
-		var utils = modules.utils;
-
-		var f1 = function() {};
-
-		/* jshint -W054 */ // The Function constructor is a form of eval
-		var f2 = new Function( '' );
-		/* jshint +W054 */
-
-		expect( utils.isObject( {} ) ).to.be.true();
-		expect( utils.isObject( [] ) ).to.be.true();
-
-		expect( utils.isObject( 1 ) ).to.be.false();
-		expect( utils.isObject( 'a' ) ).to.be.false();
-		expect( utils.isObject( true ) ).to.be.false();
-		expect( utils.isObject( undefined ) ).to.be.false();
-		expect( utils.isObject( f1 ) ).to.be.false();
-		expect( utils.isObject( f2 ) ).to.be.false();
-		expect( utils.isObject( null ) ).to.be.false();
-	} );
-} );