Node-Red configuration
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.js 715B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. var assert = require('assert')
  2. var capital = require('..')
  3. /**
  4. * Cases.
  5. */
  6. var strings = {
  7. camel: 'thisIsAString',
  8. capital: 'This Is A String',
  9. constant: 'THIS_IS_A_STRING',
  10. dot: 'this.is.a.string',
  11. pascal: 'ThisIsAString',
  12. sentence: 'This is a string.',
  13. snake: 'this_is_a_string',
  14. space: 'this is a string',
  15. title: 'This Is a String',
  16. junk: '-this__is$%a-string...'
  17. }
  18. /**
  19. * Tests.
  20. */
  21. describe('to-capital-case', function () {
  22. for (var key in strings) test(key)
  23. })
  24. /**
  25. * Create a test for a given case `key`.
  26. *
  27. * @param {String} key
  28. */
  29. function test(key) {
  30. it('should convert ' + key + ' case', function () {
  31. assert.equal(capital(strings[key]), 'This Is A String')
  32. })
  33. }