The LM Control website. Simple yet efficient.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.js 504B

1234567891011121314151617181920212223242526272829303132
  1. /*!
  2. * toidentifier
  3. * Copyright(c) 2016 Douglas Christopher Wilson
  4. * MIT Licensed
  5. */
  6. 'use strict'
  7. /**
  8. * Module exports.
  9. * @public
  10. */
  11. module.exports = toIdentifier
  12. /**
  13. * Trasform the given string into a JavaScript identifier
  14. *
  15. * @param {string} str
  16. * @returns {string}
  17. * @public
  18. */
  19. function toIdentifier (str) {
  20. return str
  21. .split(' ')
  22. .map(function (token) {
  23. return token.slice(0, 1).toUpperCase() + token.slice(1)
  24. })
  25. .join('')
  26. .replace(/[^ _0-9a-z]/gi, '')
  27. }