Sha256: 2d82532c88a746863f1d140f74f35f88bc6a32d1cca3bf308a7bc071362bb579

Contents?: true

Size: 884 Bytes

Versions: 24

Compression:

Stored size: 884 Bytes

Contents

//>>excludeStart("exclude", pragmas.exclude);
define([ "shoestring" ], function(){
//>>excludeEnd("exclude");

	/**
	 * Iterates over `shoestring` collections.
	 *
	 * @param {function} callback The callback to be invoked on each element and index
	 * @return shoestring
	 * @this shoestring
	 */
	shoestring.fn.each = function( callback ){
		return shoestring.each( this, callback );
	};

	shoestring.each = function( collection, callback ) {
		var val;
//>>includeStart("development", pragmas.development);
		if( !( "length" in collection ) ) {
			shoestring.error( 'each-length' );
		}
//>>includeEnd("development");
		for( var i = 0, il = collection.length; i < il; i++ ){
			val = callback.call( collection[i], i, collection[i] );
			if( val === false ){
				break;
			}
		}

		return collection;
	};

//>>excludeStart("exclude", pragmas.exclude);
});
//>>excludeEnd("exclude");

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.7 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.6 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.5 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.4 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.3 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.2 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.1 node_modules/shoestring/src/core/each.js
trusty-cms-4.3.5 node_modules/shoestring/src/core/each.js
trusty-cms-5.0.0 node_modules/shoestring/src/core/each.js
trusty-cms-4.3.4 node_modules/shoestring/src/core/each.js
trusty-cms-4.3.3 node_modules/shoestring/src/core/each.js
trusty-cms-4.3.2 node_modules/shoestring/src/core/each.js
trusty-cms-4.3.1 node_modules/shoestring/src/core/each.js
trusty-cms-4.3 node_modules/shoestring/src/core/each.js
trusty-cms-4.2.3 node_modules/shoestring/src/core/each.js
trusty-cms-4.2.2 node_modules/shoestring/src/core/each.js
trusty-cms-4.2.1 node_modules/shoestring/src/core/each.js
trusty-cms-4.2 node_modules/shoestring/src/core/each.js
trusty-cms-4.1.9 node_modules/shoestring/src/core/each.js