ts-serializable 3.0.32 → 3.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,7 +78,7 @@ user.getAge(); // work fine and return number
78
78
 
79
79
  Naming strategies:
80
80
  ------
81
- Supported conversion between different naming cases, such as SnakeCase, KebabCase, PascalCase. Also you can set custom name for property of json object.
81
+ Supported conversion between different naming cases, such as SnakeCase, KebabCase, PascalCase and CamelCase. Also you can set custom name for property of json object.
82
82
 
83
83
  ```typescript
84
84
  const json = {
package/dist/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export type { INamingStrategy } from "./naming-strategies/INamingStrategy.js";
14
14
  export { SnakeCaseNamingStrategy } from "./naming-strategies/SnakeCaseNamingStrategy.js";
15
15
  export { PascalCaseNamingStrategy } from "./naming-strategies/PascalCaseNamingStrategy.js";
16
16
  export { KebabCaseNamingStrategy } from "./naming-strategies/KebabCaseNamingStrategy.js";
17
+ export { CamelCaseNamingStrategy } from "./naming-strategies/CamelCaseNamingStrategy.js";
package/dist/index.js CHANGED
@@ -17,3 +17,4 @@ export { SerializationSettings } from "./models/SerializationSettings.js";
17
17
  export { SnakeCaseNamingStrategy } from "./naming-strategies/SnakeCaseNamingStrategy.js";
18
18
  export { PascalCaseNamingStrategy } from "./naming-strategies/PascalCaseNamingStrategy.js";
19
19
  export { KebabCaseNamingStrategy } from "./naming-strategies/KebabCaseNamingStrategy.js";
20
+ export { CamelCaseNamingStrategy } from "./naming-strategies/CamelCaseNamingStrategy.js";
@@ -0,0 +1,5 @@
1
+ import type { INamingStrategy } from "./INamingStrategy.js";
2
+ export declare class CamelCaseNamingStrategy implements INamingStrategy {
3
+ fromJsonName(name: string): string;
4
+ toJsonName(name: string): string;
5
+ }
@@ -0,0 +1,8 @@
1
+ export class CamelCaseNamingStrategy {
2
+ fromJsonName(name) {
3
+ return name.slice(0, 1).toUpperCase() + name.slice(1, name.length);
4
+ }
5
+ toJsonName(name) {
6
+ return name.slice(0, 1).toLowerCase() + name.slice(1, name.length);
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-serializable",
3
- "version": "3.0.32",
3
+ "version": "3.0.34",
4
4
  "description": "Serialization and deserializtion for classes",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -10,14 +10,14 @@
10
10
  "reflect-metadata": ">=0.1.0"
11
11
  },
12
12
  "devDependencies": {
13
- "@labeg/code-style": "^2.0.77",
13
+ "@labeg/code-style": "^2.0.78",
14
14
  "@types/chai": "^4.3.5",
15
15
  "@types/mocha": "^10.0.1",
16
16
  "chai": "^4.3.7",
17
17
  "mocha": "^10.2.0",
18
18
  "reflect-metadata": "^0.1.13",
19
19
  "ts-node": "^10.9.1",
20
- "typescript": "^5.1.3"
20
+ "typescript": "^5.1.6"
21
21
  },
22
22
  "scripts": {
23
23
  "cs:eslint": "eslint --fix -c .eslintrc.cjs --ext .tsx,.ts,.jsx,.js ./src/ ./tests/",