Add jsonDiff to difference component

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-12-12 22:19:59 +04:00
parent 421ca9c1b0
commit d6a72e6ab9
3 changed files with 11 additions and 2 deletions
+6 -1
View File
@@ -72,7 +72,12 @@ module.exports = createCoreService('api::parole.parole', ({strapi}) => ({
const parsePatch = Diff.parsePatch(patch)
if (parsePatch[0].hunks.length > 0) {
return patch
const jsonDiff = Diff.diffWords(oldString, newString)
return {
patch,
jsonDiff
}
}
}
}));