Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*
* @example
* var remark = require( 'remark' );
* var run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples' );
*
* var str = [
* '<section class="usage">',
Expand Down Expand Up @@ -59,16 +58,28 @@
* ''
* ];
*
* remark().use( run ).process( str.join( '\n' ), done );
* // => 'HELLO WORLD'
* var run = require( '@stdlib/_tools/remark/plugins/remark-run-javascript-examples' );
*
* function done( error ) {
* if ( error ) {
* throw error;
* }
* }
* run;
* // => function attacher( options ) {
* // var opts;
* // var err;
* //
* // // Set default options:
* // opts = copy( defaults );
* //
* // // NOTE: cannot use `arguments.length` check, as `options` may be explicitly passed as `undefined`
* // if ( options !== void 0 ) {
* // err = validate( opts, options );
* // if ( err ) {
* // throw err;
* // }
* // }
* // return runner( opts );
* // }
*/


// MODULES //

var main = require( './main.js' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ tape( 'the function computes the cube root of each indexed strided array element
cbrtBy( x.length, x, 1, y, 1, accessor );
t.deepEqual( y, expected, 'deep equal' );

x = new Array( 5 ); // sparse array
x = [];
x.length = 5; // sparse array
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];

expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];

cbrtBy( x.length, x, 1, y, 1, accessor );
t.deepEqual( y, expected, 'deep equal' );

x = new Array( 5 ); // sparse array
x = [];
x.length = 5; // sparse array
x[ 2 ] = rand();
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];

Expand Down
Loading