Skip to content

argon-rbx/luau-differ

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

LuauDiffer: A simple Luau diff library

This is a simple Luau module that performs a diff on two strings or two lists and returns a formatted diff string.

Example

Differ = require("differ")
s1 = [[hello
...
to the
world]]
s2 = [[hello
...
*at* the
world]]
diff = Differ.diff(s1, s2)

produces the output:

  hello
  ...
- to the
+ *at* the
  world

You can also diff tables:

Differ.diff({1,2,3,4,5}, {99,2,4,5,6})

(when diffing tables, it is guaranteed that for matching chunks, .old and .new refer to the same table, so chunk.old == chunk.new will succeed)

About

A Luau diff library

Resources

Stars

Watchers

Forks

Contributors

Languages

  • Luau 100.0%