1.0.38 • Published 5 months ago
convert-variable-naming-rules v1.0.38
convert-variable-naming-rules
Installation
npm i convert-variable-naming-rules
example
①
testStr⇔test_str
②
{
testStr: "testStr",
testObj: { testKeyA: "testKeyA", testKeyB: "testKeyB" },
testArr: [
{ testArrKeyA: "testKeyA", testArrKeyB: "testKeyB" },
{ testArrKeyA: "testKeyA", testArrKeyB: "testKeyB" },
],
}
⇔
{
test_str: "testStr",
test_obj: { test_key_a: "testKeyA", test_key_b: "testKeyB" },
test_arr: [
{ test_arr_key_a: "testKeyA", test_arr_key_b: "testKeyB" },
{ test_arr_key_a: "testKeyA", test_arr_key_b: "testKeyB" },
],
}
How to use
```typescript: index.ts
import { ToSnakeCase } from "convert-variable-naming-rules";
const toSnakeCase = new ToSnakeCase();
console.log(toSnakeCase.convertCamelWordToSnake("camelCase"));
```