Skip to content

Commit

Permalink
[FIX] fcn docs, test descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Jun 27, 2015
1 parent c2f267b commit 6f7818d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/accessor.js
Expand Up @@ -22,7 +22,7 @@ var LT = require( './element.js' );
* @param {Array} arr - input array
* @param {Array|Number[]|String[]|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Number|String} y - comparator
* @param {Function} accessor - accessor function for accessing array values
* @returns {Array} array of 1s and 0s, where a `1` indicates that an input array element is less than a compared value and `0` indicates that an input array element greater or equal to a compared value
* @returns {Array} array of 1s and 0s, where a `1` indicates that an input array element is less than a compared value and `0` indicates that an input array element is greater or equal to a compared value
*/
function lt( out, arr, y, clbk ) {
var len = arr.length,
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js
Expand Up @@ -39,8 +39,8 @@ function fill( n, val ) {
* FUNCTION: lt( x, y[, opts] )
* Computes an element-wise comparison (less than)
*
* @param {Number|Number[]|Array} x - input value
* @param {Array|Number[]|String[]|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Number|String} y - comparator
* @param {Number|Number[]|String|String[]|Array|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Matrix} x - input value
* @param {Number|Number[]|String|String[]|Array|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Matrix} y - comparator
* @param {Object} [opts] - function options
* @param {Boolean} [opts.copy=true] - boolean indicating if the function should return a new array
* @param {Function} [opts.accessor] - accessor function for accessing array values
Expand Down
6 changes: 3 additions & 3 deletions lib/matrix.js
Expand Up @@ -20,7 +20,7 @@ var LT = require( './element.js' );
* @param {Matrix|Number} y - either a matrix of equal dimensions or a scalar
* @returns {Matrix} output matrix of 1s and 0s, where a `1` indicates that an input element is smaller than a compared value and `0` indicates that an input element is greater or equal to a compared value
*/
function lt( out, x, y, strict ) {
function lt( out, x, y ) {
var len = x.length,
i, j,
M, N;
Expand All @@ -36,12 +36,12 @@ function lt( out, x, y, strict ) {
}
for ( i = 0; i < M; i++ ) {
for ( j = 0; j < N; j++ ) {
out.set( i, j, LT( x.get( i, j ), y.get( i, j ), strict ) );
out.set( i, j, LT( x.get( i, j ), y.get( i, j ) ) );
}
}
} else {
for ( i = 0; i < len; i++ ) {
out.data[ i ] = LT( x.data[ i ], y, strict);
out.data[ i ] = LT( x.data[ i ], y );
}
}
return out;
Expand Down
4 changes: 2 additions & 2 deletions test/test.accessor.js
Expand Up @@ -193,7 +193,7 @@ describe( 'accessor lt', function tests() {

});

it( 'should throw an error if dividing by a matrix which is not of equal length to the input array', function test() {
it( 'should throw an error if comparing to an array which is not of equal length to the input array', function test() {
expect( foo ).to.throw( Error );
function foo() {
lt( [], [1,2], [1,2,3], getValue );
Expand All @@ -203,7 +203,7 @@ describe( 'accessor lt', function tests() {
}
});

it( 'should throw an error if dividing by a typed array which is not of equal length to the input array', function test() {
it( 'should throw an error if comparing to a typed array which is not of equal length to the input array', function test() {
expect( foo ).to.throw( Error );
function foo() {
lt( [], [1,2], new Int32Array( [1,2,3] ), getValue );
Expand Down
2 changes: 1 addition & 1 deletion test/test.array.js
Expand Up @@ -146,7 +146,7 @@ describe( 'array lt', function tests() {
assert.deepEqual( actual, expected );
});

it( 'should throw an error if provided an array to be divided which is not of equal length to the input array', function test() {
it( 'should throw an error if provided a comparator array which is not of equal length to the input array', function test() {
expect( foo ).to.throw( Error );
function foo() {
lt( [], [1,2], [1,2,3] );
Expand Down
2 changes: 1 addition & 1 deletion test/test.element.js
Expand Up @@ -24,7 +24,7 @@ describe( 'element lt', function tests() {
expect( lt ).to.be.a( 'function' );
});

it( 'should correctly compare differenr values', function test() {
it( 'should correctly compare different values', function test() {
assert.strictEqual( lt( 2, 4 ), 1 );
assert.strictEqual( lt( 900, 800 ), 0 );
assert.strictEqual( lt( 'A', 'C' ), 1 );
Expand Down

0 comments on commit 6f7818d

Please sign in to comment.