Skip to content

Commit 3945934

Browse files
committed
Release v1.17.2
1 parent f9c084f commit 3945934

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ The focus of this project is minimalism and flexibility. To that end, the featur
4646
### Setup
4747

4848
For SBT simply include:
49-
`libraryDependencies += "org.typelevel" %%% "fabric-core" % "1.17.1"`
49+
`libraryDependencies += "org.typelevel" %%% "fabric-core" % "1.17.2"`
5050

5151
For parsing support include:
52-
`libraryDependencies += "org.typelevel" %%% "fabric-io" % "1.17.1"`
52+
`libraryDependencies += "org.typelevel" %%% "fabric-io" % "1.17.2"`
5353

5454
### Create
5555

core/shared/src/main/scala/fabric/Delta.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object Delta {
6767
if (j1 == j2) {
6868
None
6969
} else {
70-
Some(key -> f(j1, j2))
70+
delta(j1, j2, f).map(result => key -> result)
7171
}
7272
} *)
7373
case _ => f(json1, json2)

core/shared/src/test/scala/spec/DeltaSpec.scala

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,38 @@ class DeltaSpec extends AnyWordSpec with Matchers {
106106
)
107107
)
108108
}
109+
"build structured diff" in {
110+
val json1 = obj(
111+
"one" -> 1,
112+
"two" -> 2,
113+
"three" -> obj(
114+
"first" -> 1,
115+
"second" -> obj(
116+
"value" -> "test 1"
117+
)
118+
)
119+
)
120+
val json2 = obj(
121+
"one" -> 1,
122+
"two" -> 2,
123+
"three" -> obj(
124+
"first" -> 1,
125+
"second" -> obj(
126+
"value" -> "test 2"
127+
)
128+
)
129+
)
130+
Delta.changed(json1, json2) should be(
131+
Some(
132+
obj(
133+
"three" -> obj(
134+
"second" -> obj(
135+
"value" -> "test 2"
136+
)
137+
)
138+
)
139+
)
140+
)
141+
}
109142
}
110143
}

0 commit comments

Comments
 (0)