We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20fb6fa commit 05587d1Copy full SHA for 05587d1
test/issues/issue23.set-merge.test.ts
@@ -0,0 +1,15 @@
1
+/* eslint no-unused-expressions: 0 */
2
+import "mocha";
3
+import { expect } from "chai";
4
+import { set } from "../../lib/set";
5
+
6
+describe("pointer.set", () => {
7
+ it("should merge properties in array items", () => {
8
+ const obj: Record<string, any> = {};
9
10
+ set(obj, '/list/[0]/itemA', 1)
11
+ set(obj, '/list/[0]/itemB', 1)
12
13
+ expect(obj.list).to.deep.equal([{ itemA: 1, itemB: 1 }]);
14
+ });
15
+});
0 commit comments