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.

normalize-identifier.mjs 687B

123456789101112131415161718192021
  1. export default normalizeIdentifier
  2. import values from '../character/values.mjs'
  3. function normalizeIdentifier(value) {
  4. return (
  5. value
  6. // Collapse Markdown whitespace.
  7. .replace(/[\t\n\r ]+/g, values.space)
  8. // Trim.
  9. .replace(/^ | $/g, '')
  10. // Some characters are considered “uppercase”, but if their lowercase
  11. // counterpart is uppercased will result in a different uppercase
  12. // character.
  13. // Hence, to get that form, we perform both lower- and uppercase.
  14. // Upper case makes sure keys will not interact with default prototypal
  15. // methods: no object method is uppercase.
  16. .toLowerCase()
  17. .toUpperCase()
  18. )
  19. }