import { Bit , Byte , UInt8 } from '../types' ; example param { Number } byte return { Array } export default ( byte ) : Byte => { if ( byte > 255 || byte < 0 || ~ ~ byte !== byte ) throw new RangeError ( 'invalid byte' ) ; const result = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] ; for ( let i = 0 ; i < 8 ; i ++ ) result [ 7 - i ] = < Bit > ( ( byte >> i ) & 1 ) ; return result ; } ;