Releases: DoneDeal0/superdiff
v3.1.2
DOCUMENTATION
Add the link to the documentation website: https://superdiff.gitbook.io/donedeal0-superdiff (#33 )

v3.1.1
Bug Fix
- Fix the subpath exports that broke the library import. (#32)
ℹ️ Please refer to the latest release note for information on the new features.
v3.1.0
FEATURE
- Add a useWorkeroption tostreamListDiff. If set totrue, the diff will be run in a worker for maximum performance. Only recommended for large lists (e.g. +100,000 items).trueby default.
const diff = streamListDiff(hugeListA, hugeListB, "id", { chunksSize: 100_000,  useWorker: true });pull request #31
BREAKING CHANGES
- Enums standardization
- OBJECT_STATUSbecomes- ObjectStatus
- LIST_STATUSbecomes- ListStatus
- GRANULARITYbecomes- Granularity
 
CHORE
- Add a showWarningsoption tostreamListDiff
- Allow enum and unions for ListStatus
- Clean models
- Fix clientandserverimport subpaths
- Convert Jest config to Typescript
- Update dev dependencies
- Update README.md
v3.0.0
New Feature
- streamListDiffnow supports array, stream, and file inputs for maximum performance, polyvalence, and optimal memory usage. 🎸🦅 (#28).
Import
// If you are in a server environment
import { streamListDiff } from "@donedeal0/superdiff/server";
// If you are in a browser environment
import { streamListDiff } from "@donedeal0/superdiff/client";Input
You can send streams, file paths, or arrays as input:
If you are in a server environment
    // for a simple array
    const stream = [{ id: 1, name: "hello" }]
    // for a large array 
    const stream = Readable.from(list, { objectMode: true });
    // for a local file
    const stream = path.resolve(__dirname, "./list.json");
   If you are in a browser environment
    // for a simple array 
    const stream = [{ id: 1, name: "hello" }]
    // for a large array 
    const stream = new ReadableStream({
      start(controller) {
        list.forEach((value) => controller.enqueue(value));
        controller.close();
      },
    }); 
    // for a local file
    const stream = new File([JSON.stringify(file)], "file.json", { type: "application/json" }); 
    // for a file input
    const stream = e.target.files[0]; See the documentation for more details.
Improvement
- Improve the execution time of getObjectDiff⚡️(#30).
- Rewrite the getObjectDiffcode which is now cleaner and more elegant.
Chores
- Update the documentation.
- Create two subbuilds: clientandserverto expose an appropriate version ofstreamListDiff.
BREAKING CHANGE
- streamListDiffis no longer imported from the index, but from- @donedeal0/superdiff/serveror- @donedeal0/superdiff/client.
v2.1.0
2.1.0
New Feature
- Add a new function streamListDiffto stream the diff of two object lists. It is ideal for large lists and maximum performance 🔥 (#26).
Basic usage (see the documentation for more details)
import { streamListDiff } from "@donedeal0/superdiff";
const diff = streamListDiff([], [], "id")
diff.on("data", (chunk) => { console.log(chunk) )}
diff.on("finish", () => console.log("The full diff is available"))
diff.on("error", (err) => console.log(err))Improvement
- Improve the execution time of getListDiffby 55.6% ⚡️(#27).
Chores
- Use SWC to speed up the tests.
- Add aliases (@models,@lib).
- Clean devDependencies.
- Restructure the codebase.
- Update the documentation.
v2.0.0
2.0.0 (2024-09-29)
Features
Chore
- pre-commit script
- better linter
- improved CI, automated CD
BREAKING CHANGES
- subPropertiesDiffhas been removed from the- getObjectDiffoutput. There is now a single recursive- diffkey for more simplicity. The types have also been improved.
1.1.3
v1.1.2
v1.1.1
- add referencePropertyin theoptionsparameter ofgetListDiff.referencePropertywill consider an object to be updated instead of added or deleted if one of its properties remains stable, such as itsid. This option has no effect on other datatypes. (feature requested in #14)
getListDiff(listA, listB, { referenceProperty: "id" })- update dev dependencies
- add generic types for getListDiff
- add typescript documentation to functions
- correct README.mdgrammar and update the documentation
v1.0.9
v1.0.9
-  Add the option showOnlyto filtergetObjectDiffoutput by status:
{
  ignoreArrayOrder?: boolean // false by default,
  showOnly?: {
    statuses: ("added" | "deleted" | "updated" | "equal")[], // [] by default
    granularity?: "basic" | "deep" // "basic" by default
  }
}- 
ignoreArrayOrder: if set totrue,["hello", "world"]and["world", "hello"]will be considered asequal, because the two arrays have the same value, just not in the same order.
- 
showOnly: only returns the values whose status interest you. It has two parameters:- statuses: status you want to see in the output (ex:- ["added", "equal"])- granularity:- basiconly returns the main properties whose status match your request.
- deepcan return main properties if some of their subproperties' status match your request. The subproperties will be filtered accordingly.
 
 
 
- 
Add the option showOnlyto filtergetListDiffoutput by status:
{
  showOnly?: ("added" | "deleted" | "moved" | "updated" | "equal")[], // [] by default
}- 
showOnlygives you the option to only return the values whose status interest you (ex:["added", "equal"]).
- 
Upgrade dev dependencies 
- 
Add more tests 
Breaking changes
- in getObjectDiffoutput,subPropertiesDiff.nameis now renamedsubPropertiesDiff.property.
- The option discardArrayOrderis now renamedignoreArrayOrder