ts-serializable 4.4.0 → 4.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,487 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [4.5.0] - 2025-12-07
6
+
7
+ ### 🚀 Features
8
+
9
+ - Add issue templates for bug reports and feature requests, and enhance contribution guidelines
10
+
11
+ ### ⚙️ Miscellaneous Tasks
12
+
13
+ - Update Dependabot schedule to run on Tuesdays, remove .npmignore, and enhance package.json
14
+
15
+ # Changelog
16
+
17
+ All notable changes to this project will be documented in this file.
18
+
19
+ ## [4.4.1] - 2025-11-15
20
+
21
+ # Changelog
22
+
23
+ All notable changes to this project will be documented in this file.
24
+
25
+ ## [4.4.0] - 2025-10-18
26
+
27
+ ### 🚀 Features
28
+
29
+ - Enhance fromJSON function to accept class constructors for deserialization
30
+
31
+ # Changelog
32
+
33
+ All notable changes to this project will be documented in this file.
34
+
35
+ ## [4.3.2] - 2025-10-07
36
+
37
+ ### 🐛 Bug Fixes
38
+
39
+ - Update import paths to include .js extension for compatibility
40
+
41
+ # Changelog
42
+
43
+ All notable changes to this project will be documented in this file.
44
+
45
+ ## [4.3.1] - 2025-10-07
46
+
47
+ ### ⚙️ Miscellaneous Tasks
48
+
49
+ - Update devDependencies to latest versions
50
+
51
+ # Changelog
52
+
53
+ All notable changes to this project will be documented in this file.
54
+
55
+ ## [4.3.0] - 2025-10-07
56
+
57
+ ### 🚀 Features
58
+
59
+ - Add toJSON function and refactor Serializable class to utilize it
60
+ - Export toJSON function in index.ts
61
+
62
+ ### 🐛 Bug Fixes
63
+
64
+ - Correct import path for getPropertyName function and add UserSimple model with tests
65
+
66
+ ### 🚜 Refactor
67
+
68
+ - Reorganize functions and improve serialization methods in Serializable class
69
+ - Enhance documentation for methods in Serializable class and related functions
70
+
71
+ ### 📚 Documentation
72
+
73
+ - Update README.md to enhance features, installation instructions, and usage examples
74
+
75
+ ## [4.2.2] - 2025-09-07
76
+
77
+ ### 🐛 Bug Fixes
78
+
79
+ - ClassToFormData to use nested arrays in formdata and enable array assertions in tests
80
+
81
+ ## [4.2.1] - 2025-07-17
82
+
83
+ ### ⚙️ Miscellaneous Tasks
84
+
85
+ - Update dependencies and improve type definitions
86
+
87
+ ## [4.2.0] - 2025-04-10
88
+
89
+ ### 🚀 Features
90
+
91
+ - Enhance documentation with detailed comments for serialization classes and decorators
92
+
93
+ ### 🐛 Bug Fixes
94
+
95
+ - Correct typos and improve clarity in README documentation
96
+
97
+ ## [4.1.0] - 2025-04-10
98
+
99
+ ### 🚀 Features
100
+
101
+ - Update dependencies versions
102
+
103
+ ## [4.0.0] - 2025-03-25
104
+
105
+ ### 🚀 Features
106
+
107
+ - [**breaking**] Drop support class mutation by jsonObject decorator
108
+ - Update dependencies versions
109
+
110
+ ## [3.7.3] - 2025-01-03
111
+
112
+ ### 🐛 Bug Fixes
113
+
114
+ - Remove duplicated node module check
115
+
116
+ ## [3.7.2] - 2025-01-01
117
+
118
+ ### ⚙️ Miscellaneous Tasks
119
+
120
+ - Update actions version
121
+
122
+ ## [3.7.1] - 2025-01-01
123
+
124
+ ### 📚 Documentation
125
+
126
+ - Update readme
127
+
128
+ ## [3.7.0] - 2025-01-01
129
+
130
+ ### 🚀 Features
131
+
132
+ - Add support serialization to FormData
133
+
134
+ ## [3.6.0] - 2024-12-31
135
+
136
+ ### 🚀 Features
137
+
138
+ - Replace mocha by native node test runner
139
+
140
+ ## [3.5.0] - 2024-12-30
141
+
142
+ ### 🚀 Features
143
+
144
+ - Update eslintconfig, format code with new config
145
+
146
+ ## [3.4.0] - 2024-12-26
147
+
148
+ ### 🚀 Features
149
+
150
+ - Update dependencies versions, new config for eslint 9
151
+
152
+ ## [3.3.0] - 2024-10-05
153
+
154
+ ### 🚀 Features
155
+
156
+ - Update dependencies versions
157
+
158
+ ## [3.2.3] - 2024-06-02
159
+
160
+ ### ⚙️ Miscellaneous Tasks
161
+
162
+ - Update dependencies versions
163
+ - Sync package-lock
164
+
165
+ ## [3.2.2] - 2024-06-02
166
+
167
+ ### 📚 Documentation
168
+
169
+ - Update README
170
+
171
+ ## [3.2.1] - 2024-06-02
172
+
173
+ ### 🐛 Bug Fixes
174
+
175
+ - Begin use cliff-jumper for generate changelog and version
176
+
177
+ ## [3.2.0] - 2024-06-02
178
+
179
+ ### 🚀 Features
180
+
181
+ - Replace standart-version by git-cliff for generation changelog
182
+
183
+ ### ⚙️ Miscellaneous Tasks
184
+
185
+ - Fix got-cliff bump
186
+ - Git-cliff
187
+ - *('ts-serializable')* Release 'ts-serializable'@3.1.0
188
+ - Use cliff-jumper instead of git-cliff
189
+ - Test cliff-jumper
190
+
191
+ ## [3.1.0] - 2024-06-02
192
+
193
+ ### 🚀 Features
194
+
195
+ - Replace standart-version by git-cliff for generation changelog
196
+
197
+ ### ⚙️ Miscellaneous Tasks
198
+
199
+ - Fix got-cliff bump
200
+ - Git-cliff
201
+
202
+ ## [3.1.0] - 2024-06-02
203
+
204
+ ### 🚀 Features
205
+
206
+ - Replace standart-version by git-cliff for generation changelog
207
+
208
+ ### ⚙️ Miscellaneous Tasks
209
+
210
+ - Fix got-cliff bump
211
+ - Git-cliff
212
+
213
+ ## [3.0.59] - 2024-06-02
214
+
215
+ ### ⚙️ Miscellaneous Tasks
216
+
217
+ - *(release)* 3.0.59
218
+
219
+ ## [3.0.58] - 2024-06-02
220
+
221
+ ### 🚀 Features
222
+
223
+ - *(ci)* Initialize publish and generate changelog over github actions
224
+
225
+ ### ⚙️ Miscellaneous Tasks
226
+
227
+ - *(release)* 3.0.58
228
+
229
+ ## [3.0.57] - 2024-06-02
230
+
231
+ ### 🚀 Features
232
+
233
+ - Add support mocha test explorer, rename tests files, add generated test files from PR
234
+ - *(*)* Npm publish over github actions
235
+
236
+ ### ⚙️ Miscellaneous Tasks
237
+
238
+ - Bump version and publish to npm
239
+ - Remove unused dom lib from tsconfig, skip test generated files
240
+ - Add comment in test
241
+ - Add dist to gitignore
242
+ - *(release)* 3.0.57
243
+
244
+ ## [3.0.55] - 2024-04-21
245
+
246
+ ### ⚙️ Miscellaneous Tasks
247
+
248
+ - Bump version and publish to npm
249
+ - Bump dependencies
250
+
251
+ ## [3.0.53] - 2024-04-21
252
+
253
+ ### ⚙️ Miscellaneous Tasks
254
+
255
+ - Bump version and publish to npm
256
+ - Bump dependencies
257
+
258
+ ## [3.0.51] - 2023-12-16
259
+
260
+ ### ⚙️ Miscellaneous Tasks
261
+
262
+ - Bump version and publish to npm
263
+ - Bump dependencies
264
+
265
+ ## [3.0.49] - 2023-12-16
266
+
267
+ ### ⚙️ Miscellaneous Tasks
268
+
269
+ - Bump version and publish to npm
270
+ - Update version of packages
271
+ - Update code for new code style
272
+ - Bump dependencies
273
+
274
+ ## [3.0.47] - 2023-12-02
275
+
276
+ ### ⚙️ Miscellaneous Tasks
277
+
278
+ - Bump version and publish to npm
279
+ - Bump dependencies
280
+
281
+ ## [3.0.45] - 2023-12-02
282
+
283
+ ### ⚙️ Miscellaneous Tasks
284
+
285
+ - Bump version and publish to npm
286
+ - Update codestyle for new eslint version
287
+ - Bump dependencies
288
+
289
+ ## [3.0.43] - 2023-09-01
290
+
291
+ ### ⚙️ Miscellaneous Tasks
292
+
293
+ - Bump version and publish to npm
294
+ - Bump dependencies
295
+
296
+ ## [3.0.41] - 2023-09-01
297
+
298
+ ### ⚙️ Miscellaneous Tasks
299
+
300
+ - Bump version and publish to npm
301
+ - Bump dependencies
302
+
303
+ ## [3.0.39] - 2023-09-01
304
+
305
+ ### ⚙️ Miscellaneous Tasks
306
+
307
+ - Bump version and publish to npm
308
+ - Bump dependencies
309
+
310
+ ## [3.0.37] - 2023-09-01
311
+
312
+ ### ⚙️ Miscellaneous Tasks
313
+
314
+ - Bump version and publish to npm
315
+ - Update codestyle for new codestyle config
316
+ - Bump dependencies
317
+
318
+ ## [3.0.35] - 2023-07-14
319
+
320
+ ### ⚙️ Miscellaneous Tasks
321
+
322
+ - Bump version and publish to npm
323
+ - Bump dependencies
324
+ - Bump version and publish to npm
325
+ - Bump dependencies
326
+ - Bump version and publish to npm
327
+ - Bump dependencies
328
+ - Bump version and publish to npm
329
+ - Bump dependencies
330
+
331
+ ## [3.0.27] - 2023-02-09
332
+
333
+ ### ⚙️ Miscellaneous Tasks
334
+
335
+ - Bump version and publish to npm
336
+ - Bump dependencies
337
+
338
+ ## [3.0.25] - 2023-02-09
339
+
340
+ ### ⚙️ Miscellaneous Tasks
341
+
342
+ - Bump version and publish to npm
343
+ - Bump dependencies
344
+
345
+ ## [3.0.23] - 2023-02-08
346
+
347
+ ### ⚙️ Miscellaneous Tasks
348
+
349
+ - Bump version and publish to npm
350
+ - Bump dependencies
351
+
352
+ ## [3.0.21] - 2023-02-08
353
+
354
+ ### ⚙️ Miscellaneous Tasks
355
+
356
+ - Bump version and publish to npm
357
+ - Bump dependencies
358
+
359
+ ## [3.0.19] - 2023-02-08
360
+
361
+ ### ⚙️ Miscellaneous Tasks
362
+
363
+ - Bump version and publish to npm
364
+ - Bump dependencies
365
+
366
+ ## [3.0.17] - 2022-12-10
367
+
368
+ ### 🚀 Features
369
+
370
+ - Add fromString and toString methods
371
+
372
+ ### ⚙️ Miscellaneous Tasks
373
+
374
+ - Bump version and publish to npm
375
+ - Bump dependencies
376
+
377
+ ## [3.0.15] - 2022-11-22
378
+
379
+ ### ⚙️ Miscellaneous Tasks
380
+
381
+ - Bump version and publish to npm
382
+ - Bump dependencies
383
+
384
+ ## [3.0.13] - 2022-11-22
385
+
386
+ ### ⚙️ Miscellaneous Tasks
387
+
388
+ - Bump version and publish to npm
389
+ - Bump dependencies
390
+
391
+ ## [3.0.11] - 2022-11-22
392
+
393
+ ### ⚙️ Miscellaneous Tasks
394
+
395
+ - Bump version and publish to npm
396
+ - Disable src from npm package
397
+ - Bump dependencies
398
+
399
+ ## [3.0.9] - 2022-11-21
400
+
401
+ ### ⚙️ Miscellaneous Tasks
402
+
403
+ - Bump version and publish to npm
404
+ - Bump dependencies
405
+
406
+ ## [3.0.7] - 2022-11-21
407
+
408
+ ### ⚙️ Miscellaneous Tasks
409
+
410
+ - Bump version and publish to npm
411
+ - Bump dependencies
412
+
413
+ ## [3.0.5] - 2022-11-21
414
+
415
+ ### ⚙️ Miscellaneous Tasks
416
+
417
+ - Bump version and publish to npm
418
+ - Bump dependencies
419
+
420
+ ## [3.0.3] - 2022-11-21
421
+
422
+ ### ⚙️ Miscellaneous Tasks
423
+
424
+ - Bump version and publish to npm
425
+ - Bump dependencies
426
+
427
+ ## [3.0.1] - 2022-11-21
428
+
429
+ ### 🚀 Features
430
+
431
+ - [**breaking**] Make type module
432
+
433
+ ### 🐛 Bug Fixes
434
+
435
+ - Bump version and publish to npm
436
+ - Test for mocha in esm
437
+
438
+ ### ⚙️ Miscellaneous Tasks
439
+
440
+ - Bump dependencies
441
+
442
+ ## [2.0.67] - 2022-06-22
443
+
444
+ ### 🐛 Bug Fixes
445
+
446
+ - Bump version and publish to npm
447
+ - Bump dependencies
448
+
449
+ ## [2.0.65] - 2022-06-22
450
+
451
+ ### 🐛 Bug Fixes
452
+
453
+ - Bump version and publish to npm
454
+ - Bump dependencies
455
+
456
+ ## [2.0.63] - 2022-06-02
457
+
458
+ ### 🐛 Bug Fixes
459
+
460
+ - Bump version and publish to npm
461
+ - Bump dependencies
462
+
463
+ ## [2.0.61] - 2022-06-02
464
+
465
+ ### 🐛 Bug Fixes
466
+
467
+ - Bump version and publish to npm
468
+ - Bump dependencies
469
+
470
+ ## [2.0.59] - 2022-06-02
471
+
472
+ ### 🐛 Bug Fixes
473
+
474
+ - Bump version and publish to npm
475
+ - Bump dependencies
476
+
477
+ ## [2.0.57] - 2022-05-18
478
+
479
+ ### 🐛 Bug Fixes
480
+
481
+ - Bump dependencies
482
+
483
+ ### ⚙️ Miscellaneous Tasks
484
+
485
+ - Minor eslint rule fixes
486
+
487
+ <!-- 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,10 +1,10 @@
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
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
5
 
6
+ Powerful and flexible TypeScript/JavaScript library for serialization and deserialization with decorators
7
+
8
8
  ## ✨ Features
9
9
 
10
10
  - 🎯 **Type-safe** - Convert JSON to strongly-typed class instances
@@ -18,20 +18,45 @@
18
18
 
19
19
  ## 📋 Table of Contents
20
20
 
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)
21
+ - [ts-serializable](#ts-serializable)
22
+ - [ Features](#-features)
23
+ - [📋 Table of Contents](#-table-of-contents)
24
+ - [🚀 Installation](#-installation)
25
+ - [🎯 Quick Start](#-quick-start)
26
+ - [Why Use ts-serializable?](#why-use-ts-serializable)
27
+ - [🎓 Core Concepts](#-core-concepts)
28
+ - [Type Safety](#type-safety)
29
+ - [Default Values](#default-values)
30
+ - [Error Handling](#error-handling)
31
+ - [🎨 Decorators](#-decorators)
32
+ - [@jsonProperty](#jsonproperty)
33
+ - [@jsonIgnore](#jsonignore)
34
+ - [@jsonName](#jsonname)
35
+ - [@jsonObject](#jsonobject)
36
+ - [🔧 Advanced Usage](#-advanced-usage)
37
+ - [🔧 Standalone Functions](#-standalone-functions)
38
+ - [🐍 Naming Strategies](#-naming-strategies)
39
+ - [⚙️ Configuration Settings](#️-configuration-settings)
40
+ - [🎭 View Models and DTOs](#-view-models-and-dtos)
41
+ - [📤 FormData Conversion](#-formdata-conversion)
42
+ - [Basic Usage](#basic-usage)
43
+ - [Complex Object Graphs](#complex-object-graphs)
44
+ - [With Custom Prefix](#with-custom-prefix)
45
+ - [Appending to Existing FormData](#appending-to-existing-formdata)
46
+ - [Special Type Handling](#special-type-handling)
47
+ - [💡 Additional Features](#-additional-features)
48
+ - [Deep Copy](#deep-copy)
49
+ - [Nested Objects](#nested-objects)
50
+ - [Arrays of Objects](#arrays-of-objects)
51
+ - [📚 API Reference](#-api-reference)
52
+ - [Serializable Class Methods](#serializable-class-methods)
53
+ - [Static Methods](#static-methods)
54
+ - [Instance Methods](#instance-methods)
55
+ - [Standalone Functions](#standalone-functions)
56
+ - [Available Naming Strategies](#available-naming-strategies)
57
+ - [🤝 Contributing](#-contributing)
58
+ - [📄 License](#-license)
59
+ - [🙏 Acknowledgments](#-acknowledgments)
35
60
 
36
61
  ## 🚀 Installation
37
62
 
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!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-serializable",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
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"