ascii-control.mjs 325 B

123456789101112
  1. export default asciiControl
  2. import codes from './codes.mjs'
  3. // Note: EOF is seen as ASCII control here, because `null < 32 == true`.
  4. function asciiControl(code) {
  5. return (
  6. // Special whitespace codes (which have negative values), C0 and Control
  7. // character DEL
  8. code < codes.space || code === codes.del
  9. )
  10. }