Skip to content

Commit 86cdb1b

Browse files
committed
chore: Prepare for npm publish as scoped package
- Changed package name to @nyamathshaik/fast-json-patch - Updated version to 3.1.2-date-support.0 - Added FORK_README.md with migration instructions - This is a temporary fork until PR Starcounter-Jack#330 is merged
1 parent c4a1886 commit 86cdb1b

File tree

2 files changed

+102
-6
lines changed

2 files changed

+102
-6
lines changed

FORK_README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# @nyamathshaik/fast-json-patch
2+
3+
## ⚠️ Temporary Fork Notice
4+
5+
This is a **temporary fork** of [fast-json-patch](https://github.com/Starcounter-Jack/JSON-Patch) with added Date object support.
6+
7+
### Why This Fork Exists
8+
9+
- **PR Submitted**: [#330](https://github.com/Starcounter-Jack/JSON-Patch/pull/330)
10+
- **Status**: Waiting for merge into official package
11+
- **Purpose**: Use Date support immediately while PR is under review
12+
13+
### What's Different
14+
15+
This fork adds native Date object support:
16+
- Date objects are preserved during cloning (not converted to strings)
17+
- Date objects are compared by value, not reference
18+
- Patches contain actual Date objects, not ISO strings
19+
20+
### Installation
21+
22+
```bash
23+
npm install @nyamathshaik/fast-json-patch
24+
```
25+
26+
### Usage
27+
28+
Same API as original fast-json-patch, but now works with Date objects:
29+
30+
```javascript
31+
const { compare } = require('@nyamathshaik/fast-json-patch');
32+
33+
const obj1 = {
34+
event: {
35+
startTime: new Date('2025-11-11T10:00:00Z')
36+
}
37+
};
38+
39+
const obj2 = {
40+
event: {
41+
startTime: new Date('2025-11-11T11:00:00Z')
42+
}
43+
};
44+
45+
const patches = compare(obj1, obj2);
46+
console.log(patches);
47+
// [{ op: 'replace', path: '/event/startTime', value: Date(...) }]
48+
// ^ Date object preserved!
49+
```
50+
51+
### Migration Plan
52+
53+
**When the official PR is merged:**
54+
55+
1. Update `package.json`:
56+
```json
57+
{
58+
"dependencies": {
59+
"fast-json-patch": "^3.2.0" // or whatever version includes Date support
60+
}
61+
}
62+
```
63+
64+
2. Remove this scoped package:
65+
```bash
66+
npm uninstall @nyamathshaik/fast-json-patch
67+
npm install fast-json-patch
68+
```
69+
70+
3. No code changes needed! API is identical.
71+
72+
### Version Numbering
73+
74+
- **Base**: `3.1.1` (official fast-json-patch version)
75+
- **Fork**: `3.1.2-date-support.0`
76+
- **Suffix**: `-date-support.X` indicates this is a temporary fork
77+
78+
### Links
79+
80+
- **Official Package**: https://www.npmjs.com/package/fast-json-patch
81+
- **This Fork**: https://github.com/nyamathshaik/JSON-Patch/tree/feature/date-object-support
82+
- **PR**: https://github.com/Starcounter-Jack/JSON-Patch/pull/330
83+
84+
### License
85+
86+
MIT (same as original)
87+
88+
### Credits
89+
90+
- Original Author: Joachim Wester
91+
- Date Support: Nyamath Shaik
92+
- Generated with: Claude Code
93+
94+
---
95+
96+
**Note**: This package will be deprecated once the official package merges Date support.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "fast-json-patch",
3-
"version": "3.1.1",
4-
"description": "Fast implementation of JSON-Patch (RFC-6902) with duplex (observe changes) capabilities",
5-
"homepage": "https://github.com/Starcounter-Jack/JSON-Patch",
2+
"name": "@nyamathshaik/fast-json-patch",
3+
"version": "3.1.2-date-support.0",
4+
"description": "Fast implementation of JSON-Patch (RFC-6902) with duplex (observe changes) capabilities - Fork with Date object support",
5+
"homepage": "https://github.com/nyamathshaik/JSON-Patch",
66
"keywords": [
77
"json",
88
"patch",
@@ -11,10 +11,10 @@
1111
],
1212
"repository": {
1313
"type": "git",
14-
"url": "git://github.com/Starcounter-Jack/JSON-Patch.git"
14+
"url": "git://github.com/nyamathshaik/JSON-Patch.git"
1515
},
1616
"bugs": {
17-
"url": "https://github.com/Starcounter-Jack/JSON-Patch/issues"
17+
"url": "https://github.com/nyamathshaik/JSON-Patch/issues"
1818
},
1919
"author": {
2020
"name": "Joachim Wester",

0 commit comments

Comments
 (0)