Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

safe-from-int.js 852B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict'
  2. var codes = require('../character/codes.js')
  3. var values = require('../character/values.js')
  4. var fromCharCode = require('../constant/from-char-code.js')
  5. function safeFromInt(value, base) {
  6. var code = parseInt(value, base)
  7. if (
  8. // C0 except for HT, LF, FF, CR, space
  9. code < codes.ht ||
  10. code === codes.vt ||
  11. (code > codes.cr && code < codes.space) ||
  12. // Control character (DEL) of the basic block and C1 controls.
  13. (code > codes.tilde && code < 160) ||
  14. // Lone high surrogates and low surrogates.
  15. (code > 55295 && code < 57344) ||
  16. // Noncharacters.
  17. (code > 64975 && code < 65008) ||
  18. (code & 65535) === 65535 ||
  19. (code & 65535) === 65534 ||
  20. // Out of range
  21. code > 1114111
  22. ) {
  23. return values.replacementCharacter
  24. }
  25. return fromCharCode(code)
  26. }
  27. module.exports = safeFromInt