![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | node_modules/ | 2 years ago | - | |
![]() | LICENSE | 9 years ago | 1.1K | |
![]() | README.md | 9 years ago | 1.4K | d7c1522 post receive test [كارل مبارك] |
![]() | package.json | 2 years ago | 1.9K | |
![]() | swap-case.d.ts | 9 years ago | 88 | |
![]() | swap-case.js | 9 years ago | 577 |
Swap the case of a string.
Supports Unicode (non-ASCII characters) and non-string entities, such as objects with a toString
property, numbers and booleans. Empty values (null
and undefined
) will result in an empty string.
npm install swap-case --save
var swapCase = require('swap-case')
swapCase(null) //=> ""
swapCase('string') //=> "STRING"
swapCase('PascalCase') //=> "pASCALcASE"
swapCase('Iñtërnâtiônàlizætiøn') //=> "iÑTËRNÂTIÔNÀLIZÆTIØN"
swapCase('My String', 'tr') //=> "mY sTRİNG"
Includes a TypeScript definition.
MIT