Skip to content

Commit 729f2f4

Browse files
committed
docs: update security note to reflect partial() destructuring approach
1 parent daba7f0 commit 729f2f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/TECHNICAL_DOCUMENTATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ The library implements the following security measures:
10501050
### Security Considerations
10511051

10521052
- The `symbols` option allows user-controlled objects. While currently safe (read-only access), if you ever add write operations to user-provided objects, use `Object.create(null)` or `Object.hasOwn()` checks to prevent prototype pollution.
1053-
- On Node.js versions prior to 17, `partial()` uses `JSON.parse(JSON.stringify())` for deep cloning, which cannot serialize `NaN`, `Infinity`, or functions. The library throws a clear error in these cases rather than silently losing data.
1053+
- The `partial()` function uses destructuring to extract and freeze primitive option values at creation time. This approach is simpler than deep cloning while maintaining immutability for all option types. Mutations to the original options object after calling `partial()` will not affect the created formatter.
10541054

10551055
**The library is secure as-is and requires no additional configuration.**
10561056

0 commit comments

Comments
 (0)