ascii-control.js 343 B

1234567891011121314
  1. 'use strict'
  2. var codes = require('./codes.js')
  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. }
  11. module.exports = asciiControl