1
/*
2
* This file is part of the diffson project.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
package diffson
17

18
import lcs.Lcs
19

20
import cats._
21

22
import scala.language.higherKinds
23

24
package object jsonpatch {
25

26
  object lcsdiff {
27
    object remembering {
28
      implicit def JsonDiffDiff[Json: Jsony: Lcs]: Diff[Json, JsonPatch[Json]] =
29 1
        new JsonDiff[Json](true, true)
30
    }
31
    implicit def JsonDiffDiff[Json: Jsony: Lcs]: Diff[Json, JsonPatch[Json]] =
32 1
      new JsonDiff[Json](true, false)
33
  }
34

35
  object simplediff {
36 1
    private implicit def nolcs[Json]: Lcs[Json] = new Lcs[Json] {
37
      def savedHashes = this
38 0
      def lcs(seq1: List[Json], seq2: List[Json], low1: Int, high1: Int, low2: Int, high2: Int): List[(Int, Int)] = Nil
39
    }
40
    object remembering {
41
      implicit def JsonDiffDiff[Json: Jsony: Lcs]: Diff[Json, JsonPatch[Json]] =
42 0
        new JsonDiff[Json](false, true)
43
    }
44
    implicit def JsonDiffDiff[Json: Jsony]: Diff[Json, JsonPatch[Json]] =
45 1
      new JsonDiff[Json](false, false)
46
  }
47

48
}

Read our documentation on viewing source code .

Loading