param { string } order throws returns { boolean } export function validateSpaceOrderString ( order ) { if ( typeof ( order ) !== 'string' ) { throw Error ( 'order is not a string' ) ; } if ( order . length === 0 ) { throw Error ( 'order cannot be empty' ) ; } if ( order . length > 50 ) { throw Error ( 'order is more than 50 characters and is disallowed' ) ; } if ( ! order . match ( /^[\x20-\x7E]+$/ ) ) { throw Error ( 'order contained characters outside the range of the spec.' ) ; } return true ; }