With this package you can replace given string with another, but preserve its original case.
Default keyboard shortcut: ctrl
+cmd
+r
Example
With this code:
function testCase() {
const TESTCASE = 'TestCase'
return TESTCASE
}
If you replace testCase to newCase you will get:
function newCase() {
const NEWCASE = 'NewCase'
return NEWCASE
}
The case-keep-replace package will do four replacements:
- Replace var-like strings: testCase -> newCase
- Replace class-like strings: TestCase -> NewCase
- Replace const-like strings: TESTCASE -> NEWCASE
- Replace underscored-const-like strings: TEST_CASE -> NEW_CASE