2

I need list of transormations, like downcase, upcase, capitalize. Where is the list of such? Good documentation.

Beau Smith
  • 33,433
  • 13
  • 94
  • 101
lukaszpolowczyk
  • 605
  • 1
  • 7
  • 27

1 Answers1

7

The official documentation is snippets grammar. It shows the transforms but only provides one example. The built-in transforms are

/upcase or /downcase or /capitalize or /pascalcase

/pascalcase was added by a commit on October 2, 2018 but hasn't made it into the documentation (as of June, 2019). It works to do this:

some-file-name.js => SomeFileName // or another separator like _ or any [^a-z]/i character.

Since the capability of snippet transforms has recently been enhanced, see placeholder transforms, v1.25 release notes (with another example) there should be more examples arriving on SO soon.

For examples, see capitalized a snippet and

transform foo_bar to FooBar, camelCase and

capitalize classNames of variables and lowercase a component name.

Mark
  • 143,421
  • 24
  • 428
  • 436