describe('randos', () => { test('should return an array of finite random weights', () => { const temp = randos(10); const tempCheck = temp.filter((el) => Number.isFinite(el)); expect(temp.length).toBe(tempCheck.length); }); });
describe('ones', () => { test('should return an array with all ones', () => { const temp = ones(10); const tempCheck = temp.filter((el) => el === 1); expect(temp.length).toBe(tempCheck.length); }); });
describe('zeros', () => { test('should return an array with all zeros', () => { const temp = zeros(10); const tempCheck = temp.filter((el) => el === 0); expect(temp.length).toBe(tempCheck.length); }); });
if ( ele.attributes.format == 'binary' ) { if ( ! compressed ) { txt = txt.filter( function( el, idx, arr ) { if ( idx !== 0 ) return true; } ); if ( ele.attributes.format == 'binary' ) { if ( ! compressed ) { txt = txt.filter( function( el, idx, arr ) { if ( idx !== 0 ) return true; } ); txt = txt.filter( function( el, idx, arr ) { if ( idx % 2 !== 1 ) return true; } ); } else { if ( ele['#text'] ) { var content = ele['#text'].replace( /\n/g, ' ' ).split( ' ' ).filter( function( el, idx, arr ) { if ( el !== '' ) return el; } ); txt = txt.filter( function( el, idx, arr ) { if ( idx % 2 !== 1 ) return true; } );