ts-serializable 4.4.1 → 4.5.3

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/CHANGELOG.md ADDED
@@ -0,0 +1,513 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [4.5.3] - 2025-12-13
6
+
7
+ ### 🚜 Refactor
8
+
9
+ - *(DeserializeProperty)* Update ESLint directives for better readability
10
+
11
+ # Changelog
12
+
13
+ All notable changes to this project will be documented in this file.
14
+
15
+ ## [4.5.2] - 2025-12-09
16
+
17
+ # Changelog
18
+
19
+ All notable changes to this project will be documented in this file.
20
+
21
+ ## [4.5.1] - 2025-12-07
22
+
23
+ ### 🐛 Bug Fixes
24
+
25
+ - Update README badges for npm downloads, license, and CI workflows
26
+
27
+ # Changelog
28
+
29
+ All notable changes to this project will be documented in this file.
30
+
31
+ ## [4.5.0] - 2025-12-07
32
+
33
+ ### 🚀 Features
34
+
35
+ - Add issue templates for bug reports and feature requests, and enhance contribution guidelines
36
+
37
+ ### ⚙️ Miscellaneous Tasks
38
+
39
+ - Update Dependabot schedule to run on Tuesdays, remove .npmignore, and enhance package.json
40
+
41
+ # Changelog
42
+
43
+ All notable changes to this project will be documented in this file.
44
+
45
+ ## [4.4.1] - 2025-11-15
46
+
47
+ # Changelog
48
+
49
+ All notable changes to this project will be documented in this file.
50
+
51
+ ## [4.4.0] - 2025-10-18
52
+
53
+ ### 🚀 Features
54
+
55
+ - Enhance fromJSON function to accept class constructors for deserialization
56
+
57
+ # Changelog
58
+
59
+ All notable changes to this project will be documented in this file.
60
+
61
+ ## [4.3.2] - 2025-10-07
62
+
63
+ ### 🐛 Bug Fixes
64
+
65
+ - Update import paths to include .js extension for compatibility
66
+
67
+ # Changelog
68
+
69
+ All notable changes to this project will be documented in this file.
70
+
71
+ ## [4.3.1] - 2025-10-07
72
+
73
+ ### ⚙️ Miscellaneous Tasks
74
+
75
+ - Update devDependencies to latest versions
76
+
77
+ # Changelog
78
+
79
+ All notable changes to this project will be documented in this file.
80
+
81
+ ## [4.3.0] - 2025-10-07
82
+
83
+ ### 🚀 Features
84
+
85
+ - Add toJSON function and refactor Serializable class to utilize it
86
+ - Export toJSON function in index.ts
87
+
88
+ ### 🐛 Bug Fixes
89
+
90
+ - Correct import path for getPropertyName function and add UserSimple model with tests
91
+
92
+ ### 🚜 Refactor
93
+
94
+ - Reorganize functions and improve serialization methods in Serializable class
95
+ - Enhance documentation for methods in Serializable class and related functions
96
+
97
+ ### 📚 Documentation
98
+
99
+ - Update README.md to enhance features, installation instructions, and usage examples
100
+
101
+ ## [4.2.2] - 2025-09-07
102
+
103
+ ### 🐛 Bug Fixes
104
+
105
+ - ClassToFormData to use nested arrays in formdata and enable array assertions in tests
106
+
107
+ ## [4.2.1] - 2025-07-17
108
+
109
+ ### ⚙️ Miscellaneous Tasks
110
+
111
+ - Update dependencies and improve type definitions
112
+
113
+ ## [4.2.0] - 2025-04-10
114
+
115
+ ### 🚀 Features
116
+
117
+ - Enhance documentation with detailed comments for serialization classes and decorators
118
+
119
+ ### 🐛 Bug Fixes
120
+
121
+ - Correct typos and improve clarity in README documentation
122
+
123
+ ## [4.1.0] - 2025-04-10
124
+
125
+ ### 🚀 Features
126
+
127
+ - Update dependencies versions
128
+
129
+ ## [4.0.0] - 2025-03-25
130
+
131
+ ### 🚀 Features
132
+
133
+ - [**breaking**] Drop support class mutation by jsonObject decorator
134
+ - Update dependencies versions
135
+
136
+ ## [3.7.3] - 2025-01-03
137
+
138
+ ### 🐛 Bug Fixes
139
+
140
+ - Remove duplicated node module check
141
+
142
+ ## [3.7.2] - 2025-01-01
143
+
144
+ ### ⚙️ Miscellaneous Tasks
145
+
146
+ - Update actions version
147
+
148
+ ## [3.7.1] - 2025-01-01
149
+
150
+ ### 📚 Documentation
151
+
152
+ - Update readme
153
+
154
+ ## [3.7.0] - 2025-01-01
155
+
156
+ ### 🚀 Features
157
+
158
+ - Add support serialization to FormData
159
+
160
+ ## [3.6.0] - 2024-12-31
161
+
162
+ ### 🚀 Features
163
+
164
+ - Replace mocha by native node test runner
165
+
166
+ ## [3.5.0] - 2024-12-30
167
+
168
+ ### 🚀 Features
169
+
170
+ - Update eslintconfig, format code with new config
171
+
172
+ ## [3.4.0] - 2024-12-26
173
+
174
+ ### 🚀 Features
175
+
176
+ - Update dependencies versions, new config for eslint 9
177
+
178
+ ## [3.3.0] - 2024-10-05
179
+
180
+ ### 🚀 Features
181
+
182
+ - Update dependencies versions
183
+
184
+ ## [3.2.3] - 2024-06-02
185
+
186
+ ### ⚙️ Miscellaneous Tasks
187
+
188
+ - Update dependencies versions
189
+ - Sync package-lock
190
+
191
+ ## [3.2.2] - 2024-06-02
192
+
193
+ ### 📚 Documentation
194
+
195
+ - Update README
196
+
197
+ ## [3.2.1] - 2024-06-02
198
+
199
+ ### 🐛 Bug Fixes
200
+
201
+ - Begin use cliff-jumper for generate changelog and version
202
+
203
+ ## [3.2.0] - 2024-06-02
204
+
205
+ ### 🚀 Features
206
+
207
+ - Replace standart-version by git-cliff for generation changelog
208
+
209
+ ### ⚙️ Miscellaneous Tasks
210
+
211
+ - Fix got-cliff bump
212
+ - Git-cliff
213
+ - *('ts-serializable')* Release 'ts-serializable'@3.1.0
214
+ - Use cliff-jumper instead of git-cliff
215
+ - Test cliff-jumper
216
+
217
+ ## [3.1.0] - 2024-06-02
218
+
219
+ ### 🚀 Features
220
+
221
+ - Replace standart-version by git-cliff for generation changelog
222
+
223
+ ### ⚙️ Miscellaneous Tasks
224
+
225
+ - Fix got-cliff bump
226
+ - Git-cliff
227
+
228
+ ## [3.1.0] - 2024-06-02
229
+
230
+ ### 🚀 Features
231
+
232
+ - Replace standart-version by git-cliff for generation changelog
233
+
234
+ ### ⚙️ Miscellaneous Tasks
235
+
236
+ - Fix got-cliff bump
237
+ - Git-cliff
238
+
239
+ ## [3.0.59] - 2024-06-02
240
+
241
+ ### ⚙️ Miscellaneous Tasks
242
+
243
+ - *(release)* 3.0.59
244
+
245
+ ## [3.0.58] - 2024-06-02
246
+
247
+ ### 🚀 Features
248
+
249
+ - *(ci)* Initialize publish and generate changelog over github actions
250
+
251
+ ### ⚙️ Miscellaneous Tasks
252
+
253
+ - *(release)* 3.0.58
254
+
255
+ ## [3.0.57] - 2024-06-02
256
+
257
+ ### 🚀 Features
258
+
259
+ - Add support mocha test explorer, rename tests files, add generated test files from PR
260
+ - *(*)* Npm publish over github actions
261
+
262
+ ### ⚙️ Miscellaneous Tasks
263
+
264
+ - Bump version and publish to npm
265
+ - Remove unused dom lib from tsconfig, skip test generated files
266
+ - Add comment in test
267
+ - Add dist to gitignore
268
+ - *(release)* 3.0.57
269
+
270
+ ## [3.0.55] - 2024-04-21
271
+
272
+ ### ⚙️ Miscellaneous Tasks
273
+
274
+ - Bump version and publish to npm
275
+ - Bump dependencies
276
+
277
+ ## [3.0.53] - 2024-04-21
278
+
279
+ ### ⚙️ Miscellaneous Tasks
280
+
281
+ - Bump version and publish to npm
282
+ - Bump dependencies
283
+
284
+ ## [3.0.51] - 2023-12-16
285
+
286
+ ### ⚙️ Miscellaneous Tasks
287
+
288
+ - Bump version and publish to npm
289
+ - Bump dependencies
290
+
291
+ ## [3.0.49] - 2023-12-16
292
+
293
+ ### ⚙️ Miscellaneous Tasks
294
+
295
+ - Bump version and publish to npm
296
+ - Update version of packages
297
+ - Update code for new code style
298
+ - Bump dependencies
299
+
300
+ ## [3.0.47] - 2023-12-02
301
+
302
+ ### ⚙️ Miscellaneous Tasks
303
+
304
+ - Bump version and publish to npm
305
+ - Bump dependencies
306
+
307
+ ## [3.0.45] - 2023-12-02
308
+
309
+ ### ⚙️ Miscellaneous Tasks
310
+
311
+ - Bump version and publish to npm
312
+ - Update codestyle for new eslint version
313
+ - Bump dependencies
314
+
315
+ ## [3.0.43] - 2023-09-01
316
+
317
+ ### ⚙️ Miscellaneous Tasks
318
+
319
+ - Bump version and publish to npm
320
+ - Bump dependencies
321
+
322
+ ## [3.0.41] - 2023-09-01
323
+
324
+ ### ⚙️ Miscellaneous Tasks
325
+
326
+ - Bump version and publish to npm
327
+ - Bump dependencies
328
+
329
+ ## [3.0.39] - 2023-09-01
330
+
331
+ ### ⚙️ Miscellaneous Tasks
332
+
333
+ - Bump version and publish to npm
334
+ - Bump dependencies
335
+
336
+ ## [3.0.37] - 2023-09-01
337
+
338
+ ### ⚙️ Miscellaneous Tasks
339
+
340
+ - Bump version and publish to npm
341
+ - Update codestyle for new codestyle config
342
+ - Bump dependencies
343
+
344
+ ## [3.0.35] - 2023-07-14
345
+
346
+ ### ⚙️ Miscellaneous Tasks
347
+
348
+ - Bump version and publish to npm
349
+ - Bump dependencies
350
+ - Bump version and publish to npm
351
+ - Bump dependencies
352
+ - Bump version and publish to npm
353
+ - Bump dependencies
354
+ - Bump version and publish to npm
355
+ - Bump dependencies
356
+
357
+ ## [3.0.27] - 2023-02-09
358
+
359
+ ### ⚙️ Miscellaneous Tasks
360
+
361
+ - Bump version and publish to npm
362
+ - Bump dependencies
363
+
364
+ ## [3.0.25] - 2023-02-09
365
+
366
+ ### ⚙️ Miscellaneous Tasks
367
+
368
+ - Bump version and publish to npm
369
+ - Bump dependencies
370
+
371
+ ## [3.0.23] - 2023-02-08
372
+
373
+ ### ⚙️ Miscellaneous Tasks
374
+
375
+ - Bump version and publish to npm
376
+ - Bump dependencies
377
+
378
+ ## [3.0.21] - 2023-02-08
379
+
380
+ ### ⚙️ Miscellaneous Tasks
381
+
382
+ - Bump version and publish to npm
383
+ - Bump dependencies
384
+
385
+ ## [3.0.19] - 2023-02-08
386
+
387
+ ### ⚙️ Miscellaneous Tasks
388
+
389
+ - Bump version and publish to npm
390
+ - Bump dependencies
391
+
392
+ ## [3.0.17] - 2022-12-10
393
+
394
+ ### 🚀 Features
395
+
396
+ - Add fromString and toString methods
397
+
398
+ ### ⚙️ Miscellaneous Tasks
399
+
400
+ - Bump version and publish to npm
401
+ - Bump dependencies
402
+
403
+ ## [3.0.15] - 2022-11-22
404
+
405
+ ### ⚙️ Miscellaneous Tasks
406
+
407
+ - Bump version and publish to npm
408
+ - Bump dependencies
409
+
410
+ ## [3.0.13] - 2022-11-22
411
+
412
+ ### ⚙️ Miscellaneous Tasks
413
+
414
+ - Bump version and publish to npm
415
+ - Bump dependencies
416
+
417
+ ## [3.0.11] - 2022-11-22
418
+
419
+ ### ⚙️ Miscellaneous Tasks
420
+
421
+ - Bump version and publish to npm
422
+ - Disable src from npm package
423
+ - Bump dependencies
424
+
425
+ ## [3.0.9] - 2022-11-21
426
+
427
+ ### ⚙️ Miscellaneous Tasks
428
+
429
+ - Bump version and publish to npm
430
+ - Bump dependencies
431
+
432
+ ## [3.0.7] - 2022-11-21
433
+
434
+ ### ⚙️ Miscellaneous Tasks
435
+
436
+ - Bump version and publish to npm
437
+ - Bump dependencies
438
+
439
+ ## [3.0.5] - 2022-11-21
440
+
441
+ ### ⚙️ Miscellaneous Tasks
442
+
443
+ - Bump version and publish to npm
444
+ - Bump dependencies
445
+
446
+ ## [3.0.3] - 2022-11-21
447
+
448
+ ### ⚙️ Miscellaneous Tasks
449
+
450
+ - Bump version and publish to npm
451
+ - Bump dependencies
452
+
453
+ ## [3.0.1] - 2022-11-21
454
+
455
+ ### 🚀 Features
456
+
457
+ - [**breaking**] Make type module
458
+
459
+ ### 🐛 Bug Fixes
460
+
461
+ - Bump version and publish to npm
462
+ - Test for mocha in esm
463
+
464
+ ### ⚙️ Miscellaneous Tasks
465
+
466
+ - Bump dependencies
467
+
468
+ ## [2.0.67] - 2022-06-22
469
+
470
+ ### 🐛 Bug Fixes
471
+
472
+ - Bump version and publish to npm
473
+ - Bump dependencies
474
+
475
+ ## [2.0.65] - 2022-06-22
476
+
477
+ ### 🐛 Bug Fixes
478
+
479
+ - Bump version and publish to npm
480
+ - Bump dependencies
481
+
482
+ ## [2.0.63] - 2022-06-02
483
+
484
+ ### 🐛 Bug Fixes
485
+
486
+ - Bump version and publish to npm
487
+ - Bump dependencies
488
+
489
+ ## [2.0.61] - 2022-06-02
490
+
491
+ ### 🐛 Bug Fixes
492
+
493
+ - Bump version and publish to npm
494
+ - Bump dependencies
495
+
496
+ ## [2.0.59] - 2022-06-02
497
+
498
+ ### 🐛 Bug Fixes
499
+
500
+ - Bump version and publish to npm
501
+ - Bump dependencies
502
+
503
+ ## [2.0.57] - 2022-05-18
504
+
505
+ ### 🐛 Bug Fixes
506
+
507
+ - Bump dependencies
508
+
509
+ ### ⚙️ Miscellaneous Tasks
510
+
511
+ - Minor eslint rule fixes
512
+
513
+ <!-- generated by git-cliff -->
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ labeg@mail.ru or [discord server](https://discordapp.com/channels/974049080454045796/974049142022209566).
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,144 @@
1
+ # Contributing to ts-serializable
2
+
3
+ Thank you for your interest in contributing! This document provides guidelines for contributing to this project.
4
+
5
+ ## Code of Conduct
6
+
7
+ By participating in this project, you agree to abide by our [Code of Conduct](./CODE_OF_CONDUCT.md).
8
+
9
+ ## How to Contribute
10
+
11
+ ### Reporting Bugs
12
+
13
+ Before creating bug reports, please check the existing issues. When creating a bug report, include:
14
+
15
+ - **Clear title and description**
16
+ - **Steps to reproduce** the problem
17
+ - **Expected behavior** vs **actual behavior**
18
+ - **Code samples** that demonstrate the issue
19
+ - **Environment details** (Node.js version, npm version, OS)
20
+
21
+ ### Suggesting Enhancements
22
+
23
+ Enhancement suggestions are welcome! Please provide:
24
+
25
+ - **Clear description** of the enhancement
26
+ - **Use cases** and why it would be useful
27
+ - **Possible implementation** approach (if you have ideas)
28
+
29
+ ### Pull Requests
30
+
31
+ 1. **Fork the repository** and create your branch from `master`
32
+ 2. **Make your changes** following our coding standards
33
+ 3. **Test your changes** by running `npm test`
34
+ 4. **Commit your changes** using [Conventional Commits](https://www.conventionalcommits.org/):
35
+ - `feat:` for new features
36
+ - `fix:` for bug fixes
37
+ - `docs:` for documentation changes
38
+ - `chore:` for maintenance tasks
39
+ - `refactor:` for code refactoring
40
+ 5. **Push to your fork** and submit a pull request
41
+
42
+ ## Development Setup
43
+
44
+ ### Prerequisites
45
+
46
+ - Node.js (latest LTS version recommended)
47
+ - npm or pnpm
48
+
49
+ ### Setup Steps
50
+
51
+ ```bash
52
+ # Clone your fork
53
+ git clone https://github.com/YOUR_USERNAME/ts-serializable.git
54
+ cd ts-serializable
55
+
56
+ # Install dependencies
57
+ npm install
58
+
59
+ # Run tests
60
+ npm test
61
+ ```
62
+
63
+ ## Coding Standards
64
+
65
+ This project uses ESLint and TypeScript. Key principles:
66
+
67
+ ### Code Style
68
+
69
+ - **TypeScript**: Always use proper types
70
+ - **Decorators**: Use reflect-metadata for decorator metadata
71
+ - **Testing**: Write tests for new features
72
+ - **Documentation**: Add JSDoc comments for public APIs
73
+
74
+ ### Example
75
+
76
+ ```typescript
77
+ // Good
78
+ class User extends Serializable {
79
+ @jsonProperty(String)
80
+ public name: string = '';
81
+ }
82
+
83
+ // Always include default values
84
+ @jsonProperty(Number)
85
+ public age: number = 0;
86
+ ```
87
+
88
+ ### Commit Messages
89
+
90
+ Follow [Conventional Commits](https://www.conventionalcommits.org/):
91
+
92
+ ```bash
93
+ feat: add support for new ESLint rule
94
+ fix: correct TypeScript configuration issue
95
+ docs: update README with new examples
96
+ chore: upgrade dependencies
97
+ ```
98
+
99
+ ## Testing
100
+
101
+ Before submitting your PR:
102
+
103
+ ```bash
104
+ # Run all tests
105
+ npm test
106
+
107
+ # Run tests with coverage
108
+ npm run test:coverage
109
+
110
+ # Check for security vulnerabilities
111
+ npm audit
112
+ ```
113
+
114
+ All tests must pass before your PR can be merged.
115
+
116
+ ## Review Process
117
+
118
+ 1. **Automated checks** run on every PR (tests, linting, security)
119
+ 2. **Manual review** by maintainers
120
+ 3. **Feedback** may be provided - please address comments
121
+ 4. **Approval** - once approved, your PR will be merged
122
+
123
+ ## Release Process
124
+
125
+ Releases are automated:
126
+
127
+ 1. Maintainer merges PR to `master`
128
+ 2. Version is bumped automatically
129
+ 3. Changelog is generated
130
+ 4. Package is published to npm
131
+ 5. GitHub release is created
132
+
133
+ ## Questions?
134
+
135
+ - Open an issue with the `question` label
136
+ - Check existing issues and discussions
137
+
138
+ ## License
139
+
140
+ By contributing, you agree that your contributions will be licensed under the MIT License.
141
+
142
+ ---
143
+
144
+ Thank you for contributing to ts-serializable! 🎉
package/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # ts-serializable
2
2
 
3
- > Powerful and flexible TypeScript/JavaScript library for serialization and deserialization with decorators
4
-
5
3
  [![npm version](https://img.shields.io/npm/v/ts-serializable.svg)](https://www.npmjs.com/package/ts-serializable)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![npm downloads](https://img.shields.io/npm/dm/ts-serializable.svg)](https://www.npmjs.com/package/ts-serializable)
5
+ [![License: MIT](https://img.shields.io/github/license/LabEG/Serializable.svg)](https://github.com/LabEG/Serializable/blob/master/LICENSE)
6
+ [![Test PR](https://github.com/LabEG/Serializable/workflows/Test%20Pull%20Request/badge.svg)](https://github.com/LabEG/Serializable/actions)
7
+ [![CodeQL](https://github.com/LabEG/Serializable/workflows/CodeQL%20Advanced/badge.svg)](https://github.com/LabEG/Serializable/security/code-scanning)
8
+
9
+ Powerful and flexible TypeScript/JavaScript library for serialization and deserialization with decorators
7
10
 
8
11
  ## ✨ Features
9
12
 
@@ -18,20 +21,45 @@
18
21
 
19
22
  ## 📋 Table of Contents
20
23
 
21
- - [Installation](#-installation)
22
- - [Quick Start](#-quick-start)
23
- - [Core Concepts](#-core-concepts)
24
- - [Decorators](#-decorators)
25
- - [Advanced Usage](#-advanced-usage)
26
- - [Standalone Functions](#-standalone-functions)
27
- - [Naming Strategies](#-naming-strategies)
28
- - [Configuration Settings](#️-configuration-settings)
29
- - [View Models and DTOs](#-view-models-and-dtos)
30
- - [FormData Conversion](#-formdata-conversion)
31
- - [Additional Features](#-additional-features)
32
- - [API Reference](#-api-reference)
33
- - [Contributing](#-contributing)
34
- - [License](#-license)
24
+ - [ts-serializable](#ts-serializable)
25
+ - [ Features](#-features)
26
+ - [📋 Table of Contents](#-table-of-contents)
27
+ - [🚀 Installation](#-installation)
28
+ - [🎯 Quick Start](#-quick-start)
29
+ - [Why Use ts-serializable?](#why-use-ts-serializable)
30
+ - [🎓 Core Concepts](#-core-concepts)
31
+ - [Type Safety](#type-safety)
32
+ - [Default Values](#default-values)
33
+ - [Error Handling](#error-handling)
34
+ - [🎨 Decorators](#-decorators)
35
+ - [@jsonProperty](#jsonproperty)
36
+ - [@jsonIgnore](#jsonignore)
37
+ - [@jsonName](#jsonname)
38
+ - [@jsonObject](#jsonobject)
39
+ - [🔧 Advanced Usage](#-advanced-usage)
40
+ - [🔧 Standalone Functions](#-standalone-functions)
41
+ - [🐍 Naming Strategies](#-naming-strategies)
42
+ - [⚙️ Configuration Settings](#️-configuration-settings)
43
+ - [🎭 View Models and DTOs](#-view-models-and-dtos)
44
+ - [📤 FormData Conversion](#-formdata-conversion)
45
+ - [Basic Usage](#basic-usage)
46
+ - [Complex Object Graphs](#complex-object-graphs)
47
+ - [With Custom Prefix](#with-custom-prefix)
48
+ - [Appending to Existing FormData](#appending-to-existing-formdata)
49
+ - [Special Type Handling](#special-type-handling)
50
+ - [💡 Additional Features](#-additional-features)
51
+ - [Deep Copy](#deep-copy)
52
+ - [Nested Objects](#nested-objects)
53
+ - [Arrays of Objects](#arrays-of-objects)
54
+ - [📚 API Reference](#-api-reference)
55
+ - [Serializable Class Methods](#serializable-class-methods)
56
+ - [Static Methods](#static-methods)
57
+ - [Instance Methods](#instance-methods)
58
+ - [Standalone Functions](#standalone-functions)
59
+ - [Available Naming Strategies](#available-naming-strategies)
60
+ - [🤝 Contributing](#-contributing)
61
+ - [📄 License](#-license)
62
+ - [🙏 Acknowledgments](#-acknowledgments)
35
63
 
36
64
  ## 🚀 Installation
37
65
 
package/SECURITY.md ADDED
@@ -0,0 +1,109 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ We actively support the following versions of `ts-serializable` with security updates:
6
+
7
+ | Version | Supported |
8
+ | ------- | ------------------ |
9
+ | 4.x | :white_check_mark: |
10
+ | 3.x | :x: |
11
+ | < 3.0 | :x: |
12
+
13
+ ## Reporting a Vulnerability
14
+
15
+ We take the security of `ts-serializable` seriously. If you discover a security vulnerability, please follow these steps:
16
+
17
+ ### How to Report
18
+
19
+ 1. **DO NOT** open a public GitHub issue for security vulnerabilities
20
+ 2. Send a detailed report to the repository maintainer via:
21
+ - GitHub Security Advisory: [Report a vulnerability](https://github.com/LabEG/Serializable/security/advisories/new)
22
+ - Email: Create an issue in the [issue tracker](https://github.com/LabEG/Serializable/issues) marked as **Security** (if no sensitive details need to be shared)
23
+
24
+ ### What to Include
25
+
26
+ Please provide the following information in your report:
27
+
28
+ - **Description**: A clear description of the vulnerability
29
+ - **Impact**: What could an attacker accomplish by exploiting this vulnerability
30
+ - **Reproduction**: Step-by-step instructions to reproduce the issue
31
+ - **Version**: The version of `ts-serializable` affected
32
+ - **Environment**: Relevant environment details (Node.js version, TypeScript version, etc.)
33
+ - **Suggested Fix** (optional): If you have ideas on how to fix the vulnerability
34
+
35
+ ### Response Timeline
36
+
37
+ - **Initial Response**: Within 48 hours of receiving the report
38
+ - **Status Update**: Within 7 days with either a fix timeline or request for more information
39
+ - **Resolution**: Security patches will be released as soon as possible, typically within 14 days for critical issues
40
+
41
+ ### Security Update Process
42
+
43
+ 1. The vulnerability is confirmed and assessed
44
+ 2. A fix is developed and tested
45
+ 3. A security advisory is prepared
46
+ 4. A new version is released with the fix
47
+ 5. The security advisory is published with CVE (if applicable)
48
+
49
+ ## Security Best Practices
50
+
51
+ When using `ts-serializable`:
52
+
53
+ ### For Package Consumers
54
+
55
+ - Always use the latest stable version
56
+ - Regularly update dependencies using `npm update` or `npm audit fix`
57
+ - Review the [CHANGELOG](./CHANGELOG.md) for security-related updates
58
+ - Use `npm audit` to check for known vulnerabilities in dependencies
59
+
60
+ ### For Contributors
61
+
62
+ - Follow secure coding practices
63
+ - Run `npm audit` before submitting pull requests
64
+ - Never commit sensitive information (API keys, passwords, tokens)
65
+ - Test changes thoroughly with various configurations
66
+
67
+ ## Dependency Security
68
+
69
+ This package relies on reflect-metadata and has minimal dependencies. We:
70
+
71
+ - Monitor security advisories for all dependencies
72
+ - Update dependencies promptly when security issues are discovered
73
+ - Use `npm audit` in our CI/CD pipeline
74
+ - Follow semantic versioning to ensure stable updates
75
+
76
+ ## Known Security Considerations
77
+
78
+ As a serialization library, `ts-serializable`:
79
+
80
+ - **Processes data at runtime** - handles JSON serialization/deserialization
81
+ - **Uses decorators** - requires reflect-metadata polyfill
82
+ - **Does not access network resources** - all operations are local
83
+ - **May handle sensitive data** - be careful with @jsonIgnore for passwords/secrets
84
+
85
+ However, always ensure you:
86
+
87
+ - Install packages from official npm registry
88
+ - Verify package integrity using `npm audit`
89
+ - Review configuration changes before applying
90
+
91
+ ## Disclosure Policy
92
+
93
+ When a security vulnerability is fixed:
94
+
95
+ 1. We will credit the reporter (unless they wish to remain anonymous)
96
+ 2. Details will be disclosed after a fix is available
97
+ 3. We will publish a security advisory on GitHub
98
+ 4. The vulnerability will be documented in the CHANGELOG
99
+
100
+ ## Contact
101
+
102
+ For any security-related questions or concerns, please:
103
+
104
+ - Open a [GitHub Security Advisory](https://github.com/LabEG/Serializable/security/advisories/new)
105
+ - Create an issue at: <https://github.com/LabEG/Serializable/issues>
106
+
107
+ ---
108
+
109
+ Thank you for helping keep `ts-serializable` and its users safe!
@@ -36,9 +36,9 @@ import { onWrongType } from "./OnWrongType.js";
36
36
  * // Returns the string "30" since String is checked first
37
37
  * ```
38
38
  */
39
- // eslint-disable-next-line max-lines-per-function, max-statements, complexity
39
+ // eslint-disable-next-line max-lines-per-function, max-statements
40
40
  export const deserializeProperty = (obj, prop, acceptedTypes, jsonValue, settings
41
- // eslint-disable-next-line max-params
41
+ // eslint-disable-next-line max-params, complexity
42
42
  ) => {
43
43
  for (const acceptedType of acceptedTypes) { // Type Symbol is not a property
44
44
  if ( // Null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-serializable",
3
- "version": "4.4.1",
3
+ "version": "4.5.3",
4
4
  "author": "Eugene Labutin",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LabEG/Serializable#readme",
@@ -8,6 +8,15 @@
8
8
  "main": "./dist/index.js",
9
9
  "type": "module",
10
10
  "typings": "./dist/index.d.ts",
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE",
15
+ "CHANGELOG.md",
16
+ "CODE_OF_CONDUCT.md",
17
+ "CONTRIBUTING.md",
18
+ "SECURITY.md"
19
+ ],
11
20
  "repository": {
12
21
  "type": "git",
13
22
  "url": " git@github.com:LabEG/Serializable.git"
@@ -28,7 +37,7 @@
28
37
  "build": "tsc --project tsconfig.build.json && node ./dist/index.js",
29
38
  "prepublishOnly": "npm run lint && npm run build && npm run test",
30
39
  "release": "cliff-jumper --name 'ts-serializable' --package-path '.' --no-skip-changelog --no-skip-tag",
31
- "prepare": "husky install"
40
+ "prepare": "husky"
32
41
  },
33
42
  "peerDependencies": {
34
43
  "reflect-metadata": ">=0.1.0"