ts-serializable 3.3.0 → 3.5.0

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.
@@ -87,7 +87,7 @@ export declare class Serializable {
87
87
  */
88
88
  protected onWrongType(prop: string, message: string, jsonValue: unknown): void;
89
89
  /**
90
- * //todo: write jsdoc
90
+ * Deserialize one property
91
91
  *
92
92
  * @private
93
93
  * @param {object} object
@@ -135,7 +135,7 @@ export class Serializable {
135
135
  console.error(`${this.constructor.name}.fromJSON: json.${prop} ${message}:`, jsonValue);
136
136
  }
137
137
  /**
138
- * //todo: write jsdoc
138
+ * Deserialize one property
139
139
  *
140
140
  * @private
141
141
  * @param {object} object
@@ -145,7 +145,7 @@ export class Serializable {
145
145
  * @returns {(Object | null | void)}
146
146
  * @memberof Serializable
147
147
  */
148
- // eslint-disable-next-line @typescript-eslint/max-params
148
+ // eslint-disable-next-line max-params
149
149
  deserializeProperty(prop, acceptedTypes, jsonValue, settings) {
150
150
  for (const acceptedType of acceptedTypes) { // Type Symbol is not a property
151
151
  if ( // Null
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { Serializable } from "../classes/Serializable.js";
2
3
  export const jsonObject = (settings, extend) => (target) => {
3
4
  if (extend === true) {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable class-methods-use-this */
1
2
  export class CamelCaseNamingStrategy {
2
3
  fromJsonName(name) {
3
4
  return name.slice(0, 1).toUpperCase() + name.slice(1, name.length);
@@ -1,3 +1,4 @@
1
+ /* eslint-disable class-methods-use-this */
1
2
  export class KebabCaseNamingStrategy {
2
3
  fromJsonName(name) {
3
4
  return name.replace(/-\w/gu, (group) => group[1].toUpperCase());
@@ -1,3 +1,4 @@
1
+ /* eslint-disable class-methods-use-this */
1
2
  export class PascalCaseNamingStrategy {
2
3
  fromJsonName(name) {
3
4
  return name.slice(0, 1).toLowerCase() + name.slice(1, name.length);
@@ -1,3 +1,4 @@
1
+ /* eslint-disable class-methods-use-this */
1
2
  export class SnakeCaseNamingStrategy {
2
3
  fromJsonName(name) {
3
4
  return name.replace(/_\w/gu, (group) => group[1].toUpperCase());
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "ts-serializable",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "author": "Eugene Labutin",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LabEG/Serializable#readme",
7
- "description": "Serialization and deserializtion for classes",
7
+ "description": "Serialization and deserialization for classes",
8
8
  "main": "./dist/index.js",
9
9
  "type": "module",
10
10
  "typings": "./dist/index.d.ts",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "lint-staged": {
19
19
  "./(src|tests)/**/*.(ts|tsx|js|jsx)": [
20
- "eslint --fix -c .eslintrc.cjs --ext .tsx,.ts,.jsx,.js"
20
+ "eslint --fix"
21
21
  ]
22
22
  },
23
23
  "scripts": {
24
- "lint": "eslint --fix -c .eslintrc.cjs --ext .tsx,.ts,.jsx,.js ./src/ ./tests/",
24
+ "lint": "eslint --fix ./src/ ./tests/",
25
25
  "test": "mocha",
26
26
  "build": "tsc --project tsconfig.build.json && node ./dist/index.js",
27
27
  "prepublishOnly": "npm run lint && npm run build && npm run test",
@@ -32,20 +32,20 @@
32
32
  "reflect-metadata": ">=0.1.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@commitlint/cli": "^19.5.0",
36
- "@commitlint/config-conventional": "^19.5.0",
37
- "@favware/cliff-jumper": "^4.1.0",
38
- "@labeg/code-style": "^4.4.0",
39
- "@types/chai": "^5.0.0",
40
- "@types/mocha": "^10.0.8",
41
- "chai": "^5.1.1",
42
- "husky": "^9.1.6",
43
- "lint-staged": "^15.2.10",
44
- "mocha": "^10.7.3",
35
+ "@commitlint/cli": "^19.6.1",
36
+ "@commitlint/config-conventional": "^19.6.0",
37
+ "@favware/cliff-jumper": "^5.0.0",
38
+ "@labeg/code-style": "^5.5.0",
39
+ "@types/chai": "^5.0.1",
40
+ "@types/mocha": "^10.0.10",
41
+ "chai": "^5.1.2",
42
+ "husky": "^9.1.7",
43
+ "lint-staged": "^15.3.0",
44
+ "mocha": "^11.0.1",
45
45
  "reflect-metadata": "^0.2.2",
46
46
  "ts-node": "^10.9.2",
47
- "tsx": "^4.19.1",
48
- "typescript": "^5.6.2"
47
+ "tsx": "^4.19.2",
48
+ "typescript": "^5.7.2"
49
49
  },
50
50
  "keywords": [
51
51
  "serialization",