File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -246,14 +246,14 @@ async function getValidClientStream<T extends Record<string, unknown>>(
246
246
247
247
/**
248
248
* Streams the diff of two object lists
249
- * @param {Record<string, unknown>[] } prevList - The original object list.
250
- * @param {Record<string, unknown>[] } nextList - The new object list.
251
- * @param {ReferenceProperty<T> } referenceProperty - A common property in all the objects of your lists (e.g. `id`)
249
+ * @param {ReadableStream | File | Record<string, unknown>[] } prevList - The original object list.
250
+ * @param {ReadableStream | File | Record<string, unknown>[] } nextList - The new object list.
251
+ * @param {string } referenceProperty - A common property in all the objects of your lists (e.g. `id`)
252
252
* @param {ListStreamOptions } options - Options to refine your output.
253
253
- `chunksSize`: the number of object diffs returned by each streamed chunk. (e.g. `0` = 1 object diff by chunk, `10` = 10 object diffs by chunk).
254
254
- `showOnly`: returns only the values whose status you are interested in. (e.g. `["added", "equal"]`)
255
255
- `considerMoveAsUpdate`: if set to `true` a `moved` object will be considered as `updated`
256
- * @returns EventEmitter
256
+ * @returns StreamListener
257
257
*/
258
258
export function streamListDiffClient < T extends Record < string , unknown > > (
259
259
prevList : ReadableStream < T > | File | T [ ] ,
Original file line number Diff line number Diff line change @@ -232,6 +232,17 @@ function getValidStream<T>(
232
232
throw new Error ( `Invalid ${ listType } . Expected Readable, Array, or File.` ) ;
233
233
}
234
234
235
+ /**
236
+ * Streams the diff of two object lists
237
+ * @param {Readable | FilePath | Record<string, unknown>[] } prevList - The original object list.
238
+ * @param {Readable | FilePath | Record<string, unknown>[] } nextList - The new object list.
239
+ * @param {string } referenceProperty - A common property in all the objects of your lists (e.g. `id`)
240
+ * @param {ListStreamOptions } options - Options to refine your output.
241
+ - `chunksSize`: the number of object diffs returned by each streamed chunk. (e.g. `0` = 1 object diff by chunk, `10` = 10 object diffs by chunk).
242
+ - `showOnly`: returns only the values whose status you are interested in. (e.g. `["added", "equal"]`)
243
+ - `considerMoveAsUpdate`: if set to `true` a `moved` object will be considered as `updated`
244
+ * @returns StreamListener
245
+ */
235
246
export function streamListDiff < T extends Record < string , unknown > > (
236
247
prevStream : Readable | FilePath | T [ ] ,
237
248
nextStream : Readable | FilePath | T [ ] ,
You can’t perform that action at this time.
0 commit comments