Преглед на файлове

Add function name to anonymous utils methods

Oskar Wrobel преди 9 години
родител
ревизия
b0f86e3e9d

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

@@ -22,7 +22,7 @@
  * @param {Array} b Array to compare with.
  * @returns {utils.ArrayRelation} How array `a` is related to `b`.
  */
-export default function( a, b ) {
+export default function compareArrays( a, b ) {
 	const minLen = Math.min( a.length, b.length );
 
 	for ( let i = 0; i < minLen; i++ ) {

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

@@ -14,7 +14,7 @@
  * @param {Iterable.<*>} iterator Any iterator.
  * @returns {Number} Number of items returned by that iterator.
  */
-export default function( iterator ) {
+export default function count( iterator ) {
 	let count = 0;
 
 	for ( let _ of iterator ) { // jshint ignore:line

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

@@ -12,6 +12,6 @@
  * @param {*} value The value to check.
  * @returns {Boolean} True if value implements iterator interface.
  */
-export default function( value ) {
+export default function isIterable( value ) {
 	return !!( value && value[ Symbol.iterator ] );
 }

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

@@ -11,7 +11,7 @@
  * @memberOf utils
  * @returns {Boolean} `true` if given maps are equal, `false` otherwise.
  */
-export default function( mapA, mapB ) {
+export default function mapsEqual( mapA, mapB ) {
 	if ( mapA.size != mapB.size ) {
 		return false;
 	}

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

@@ -29,7 +29,7 @@
  * @param {Function} [baseClass] Class which prototype will be extended.
  * @param {Object} [...mixins] Objects from which to get properties.
  */
-export default function( baseClass, ...mixins ) {
+export default function mix( baseClass, ...mixins ) {
 	mixins.forEach( ( mixin ) => {
 		Object.getOwnPropertyNames( mixin ).concat( Object.getOwnPropertySymbols( mixin ) )
 			.forEach( ( key ) => {

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

@@ -13,7 +13,7 @@
  * @param {Iterable.<*>} iterable
  * @returns {*}
  */
-export default function( index, iterable ) {
+export default function nth( index, iterable ) {
 	for ( let item of iterable ) {
 		if ( index === 0 ) {
 			return item;

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

@@ -15,7 +15,7 @@
  * @param {Object} obj Object to transform.
  * @returns {Map} Map created from object.
  */
-export default function( obj ) {
+export default function objectToMap( obj ) {
 	const map = new Map();
 
 	for ( let key in obj ) {

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

@@ -15,7 +15,7 @@
  * @memberOf utils
  * @returns {Function} The spy function.
  */
-export default function() {
+export default function spy() {
 	return function spy() {
 		spy.called = true;
 	};

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

@@ -19,7 +19,7 @@ import objectToMap from './objecttomap.js';
  * @param {Object|Iterable} data Object or iterable to transform.
  * @returns {Map} Map created from data.
  */
-export default function( data ) {
+export default function toMap( data ) {
 	if ( isPlainObject( data ) ) {
 		return objectToMap( data );
 	} else {