Pinkstack/roblox-luau-corpus-text huggingface dataset:
--- Returns a function that is a fuzzy finder for the specified set or container.
-- Can pass an array of strings, array of instances, array of EnumItems,
-- array of dictionaries with a Name key or an instance (in which case its children will be used)
-- Exact matches will be inserted in the front of the resulting array


function Util.MakeFuzzyFinder(setOrContainer)
	local names
	local instances = {}

	if typeof(setOrContainer) == "Enum" then
		setOrContainer = setOrContainer:GetEnumItems()
	end

	if typeof(setOrContainer) == "Instance" then
		names, instances = transformInstanceSet(setOrContainer:GetChildren())
	elseif typeof(setOrContainer) == "table" then
		if
			typeof(setOrContainer[1]) == "Instance" or typeof(setOrContainer[1]) == "EnumItem" or
				(typeof(setOrContainer[1]) == "table" and typeof(setOrContainer[1].Name) == "string")
		 then
			names, instances = transformInstanceSet(setOrContainer)
		elseif type(setOrContainer[1]) == "string" then
			names = setOrContainer
		elseif setOrContainer[1] ~= nil then
			error("MakeFuzzyFinder only accepts tables of instances or strings.")
		else
			names = {}
		end
	else
		error("MakeFuzzyFinder only accepts a table, Enum, or Instance.")
	end

	-- Searches the set (checking exact matches first)
	return function(text, returnFirst)
		local results = {}

		for i, name in pairs(names) do
			local value = instances and instances[i] or name

			-- Continue on checking for non-exact matches...
			-- Still need to loop through everything, even on returnFirst, because possibility of an exact match.
			if name:lower() == text:lower() then
				if returnFirst then
					return value
				else
					table.insert(results, 1, value)
				end
			elseif name:lower():sub(1, #text) == text:lower() then
				results[#results + 1] = value
			end
		end

		if returnFirst then
			return results[1]
		end

		return results
	end
end
--[[Drivetrain]]

	
	Tune.Config			= "RWD"		--"FWD" , "RWD" , "AWD"
	
	--Differential Settings	
	Tune.FDiffSlipThres	= 50		-- 1 - 100%				(Max threshold of applying full lock determined by deviation from avg speed)
	Tune.FDiffLockThres	= 50	-- 0 - 100%				(0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
	Tune.RDiffSlipThres	= 50		-- 1 - 100%
	Tune.RDiffLockThres	= 50		-- 0 - 100%
	Tune.CDiffSlipThres	= 50		-- 1 - 100%				[AWD Only]
	Tune.CDiffLockThres	= 50		-- 0 - 100%				[AWD Only]
	
	--Traction Control Settings
	Tune.TCSEnabled		= true		-- Implements TCS
	Tune.TCSThreshold	= 20		-- Slip speed allowed before TCS starts working (in SPS)
	Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
	Tune.TCSLimit		= 10		-- Minimum amount of torque at max reduction (in percent)
-- Adds particles to the WeaponsSystem based off player creations (or uses a default if not present)



local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")

local blaster = ServerStorage:WaitForChild("Weapons"):WaitForChild("Blaster")
local WeaponSystem = blaster:WaitForChild("WeaponsSystem")
local RocketAsset = WeaponSystem.Assets.Effects.Shots.Rocket
--[[
	Retries a Promise-returning callback N times until it succeeds.
]]


function Promise.retry(callback, times, ...)
	assert(type(callback) == "function", "Parameter #1 to Promise.retry must be a function")
	assert(type(times) == "number", "Parameter #2 to Promise.retry must be a number")

	local args, length = {...}, select("#", ...)

	return Promise.resolve(callback(...)):catch(function(...)
		if times > 0 then
			return Promise.retry(callback, times - 1, unpack(args, 1, length))
		else
			return Promise.reject(...)
		end
	end)
end
Promise.prototype.Retry = Promise.prototype.retry
--[=[
	@tag Component Class
	@function HeartbeatUpdate
	@param dt number
	@within Component

	If this method is present on a component, then it will be
	automatically connected to `RunService.Heartbeat`.

	:::note Method
	This is a method, not a function. This is a limitation
	of the documentation tool which should be fixed soon.
	:::
	
	```lua
	local MyComponent = Component.new({Tag = "MyComponent"})
	
	function MyComponent:HeartbeatUpdate(dt)
	end
	```
]=]
--[=[
	@tag Component Class
	@function SteppedUpdate
	@param dt number
	@within Component

	If this method is present on a component, then it will be
	automatically connected to `RunService.Stepped`.

	:::note Method
	This is a method, not a function. This is a limitation
	of the documentation tool which should be fixed soon.
	:::
	
	```lua
	local MyComponent = Component.new({Tag = "MyComponent"})
	
	function MyComponent:SteppedUpdate(dt)
	end
	```
]=]
--[=[
	@tag Component Class
	@function RenderSteppedUpdate
	@param dt number
	@within Component
	@client

	If this method is present on a component, then it will be
	automatically connected to `RunService.RenderStepped`. If
	the `[Component].RenderPriority` field is found, then the
	component will instead use `RunService:BindToRenderStep()`
	to bind the function.

	:::note Method
	This is a method, not a function. This is a limitation
	of the documentation tool which should be fixed soon.
	:::
	
	```lua
	-- Example that uses `RunService.RenderStepped` automatically:

	local MyComponent = Component.new({Tag = "MyComponent"})
	
	function MyComponent:RenderSteppedUpdate(dt)
	end
	```
	```lua
	-- Example that uses `RunService:BindToRenderStep` automatically:
	
	local MyComponent = Component.new({Tag = "MyComponent"})

	-- Defining a RenderPriority will force the component to use BindToRenderStep instead
	MyComponent.RenderPriority = Enum.RenderPriority.Camera.Value
	
	function MyComponent:RenderSteppedUpdate(dt)
	end
	```
]=]



function Component:Destroy()
	self[KEY_TROVE]:Destroy()
end

return Component
-------- OMG HAX



r = game:service("RunService")


local damage = 5


local slash_damage = 10
local lunge_damage = 20

sword = script.Parent.Handle
Tool = script.Parent


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool
	
	
	force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.3)
	swordOut()
	wait(.3)
	force.Parent = nil
	wait(.5)
	swordUp()

	damage = slash_damage
end

function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end

function swordAcross()
	-- parry
end


Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	t = r.Stepped:wait()

	if (t - last_attack < .2) then
		lunge()
	else
		attack()
	end

	last_attack = t

	wait(.5)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
--[=[
	Detects if a dictionary has a certain key.
	
	```lua
	local Dictionary = {
		Hay = "A",
		MoreHay = "B",
		Needle = "C",
		SomeHay = "D",
	}
	
	print(TableKit.HasKey(Dictionary, "Needle")) -- prints true
	```
	
	@within TableKit
	@param dictionary table
	@param key unknown
	@return boolean
]=]


function TableKit.HasKey(dictionary: { [any]: unknown }, key: any): boolean
	return dictionary[key] ~= nil
end
-- Services


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local StarterPack = game:GetService("StarterPack")

local Conf = require(ReplicatedFirst.Configurations.MainConfiguration)
local Log = require(ReplicatedStorage.Libraries.Log)
local Util = require(ReplicatedStorage.Libraries.Util)
local Broadcast = require(ReplicatedStorage.Libraries.Broadcast)

local MatchmakingDestination = require(ReplicatedStorage.Libraries.MatchmakingDestination)

local WeaponsSystem = require(ReplicatedStorage.WeaponsSystem.WeaponsSystem)
local DamageHandler = require(ReplicatedStorage.Core.DamageHandler)

local WeaponsFolder = ReplicatedStorage.Assets.Weapons
--[[Transmission]]


Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
--------STAGE--------



game.Workspace.Screens.Current.Value = game.Workspace.Screens.Main.Value
game.Workspace.back1.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.back2.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.crewbig1.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.crewsmall1.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.djstand.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.djtv.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.side1.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.side2.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.side3.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.side4.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.side11.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.side12.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.sidebig1.Decal.Texture = game.Workspace.Screens.Main.Value

if game.Workspace.CurrentStageTV.Value == "1" then
game.Workspace.main1.Decal.Texture = game.Workspace.Screens.Main.Value
end
----------------------------------
------------FUNCTIONS-------------
----------------------------------



function WeldChanged(property)
	if property == "Parent" and SeatWeld.Parent == nil then
		SeatWeld = nil
		Deactivate()
		BreakSeatConnections()
	end
end
function ChildAdded(child)
	if child:IsA("Weld") then
		local root = child.Part1
		local character = root.Parent
		local player = game.Players:GetPlayerFromCharacter(character)
		if player then
			SeatWeld = child
			Activate(player)
			MakeSeatConnections()
		end
	end
end
-------------------------


function onClicked()
script.Parent.Parent.Down.ClickDetector.MaxActivationDistance = 0
script.Parent.Parent.Call2.ClickDetector.MaxActivationDistance = 0
script.Parent.Parent.Call.ClickDetector.MaxActivationDistance = 0
script.Parent.Click:Play()
script.Parent.BrickColor = BrickColor.new("Really red")
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.Parent.Up.ClickDetector.MaxActivationDistance = 0
wait(2)
script.Parent.Parent.DoorOutside2.CanCollide = true
script.Parent.Parent.DoorOutside2.Transparency = 0
script.Parent.Parent.DoorInside.Transparency = 0
script.Parent.Parent.DoorInside.CanCollide = true
script.Parent.Parent.DoorInside.Close:Play()
wait(3)
script.Parent.Parent.Screen.SurfaceGui.Frame.Down.Visible = true
Car.Start:Play()
Car.Run:Play()
LiftDown:Play()
wait(12)
script.Parent.Parent.Screen.SurfaceGui.Frame.TextLabel.Text = "SECRET BASE"
script.Parent.Parent.Screen.SurfaceGui.Frame.Down.Visible = false
Car.Start:Stop()
Car.Run:Stop()
Car.Stop:Play()
wait(2)
door.Transparency = 1
door.CanCollide = false
script.Parent.Parent.DoorOutside.CanCollide = false
script.Parent.Parent.DoorOutside.Transparency = 1
Car.Ding:Play()
wait(5)
script.Parent.Parent.Call2.ClickDetector.MaxActivationDistance = 12
script.Parent.BrickColor = BrickColor.new("Lime green")
script.Parent.Parent.Up.BrickColor = BrickColor.new("Lime green")
script.Parent.Parent.Up.ClickDetector.MaxActivationDistance = 12
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[=[
	Binds the given update function to render stepped.

	```lua
	local spring = Spring.new(0)
	local maid = Maid.new()

	local startAnimation, maid._stopAnimation = StepUtils.bindToRenderStep(function()
		local animating, position = SpringUtils.animating(spring)

		print(position)

		return animating
	end)

	spring.t = 1
	startAnimation()
	```

	:::tip
	Be sure to call the disconnect function when cleaning up, otherwise you may memory leak.
	:::

	@param update () -> boolean -- should return true while it needs to update
	@return (...) -> () -- Connect function
	@return () -> () -- Disconnect function
]=]


function StepUtils.bindToRenderStep(update)
	return StepUtils.bindToSignal(RunService.RenderStepped, update)
end
--[=[
	Retrieves the rank of the player in the group.

	@param player Player
	@param groupId number
	@return Promise<number> -- Generally from 0 to 255
]=]


function GroupUtils.promiseRankInGroup(player, groupId)
	assert(typeof(player) == "Instance" and player:IsA("Player"), "Bad player")
	assert(type(groupId) == "number", "Bad groupId")

	return Promise.spawn(function(resolve, reject)
		local rank = nil
		local ok, err = pcall(function()
			rank = player:GetRankInGroup(groupId)
		end)

		if not ok then
			return reject(err)
		end

		if type(rank) ~= "number" then
			return reject("Rank is not a number")
		end

		return resolve(rank)
	end)
end
-----------------
--| Constants |--
-----------------



local BLAST_RADIUS = 8 -- Blast radius of the explosion
local BLAST_DAMAGE = 100 -- Amount of damage done to players
local BLAST_FORCE = 1000 -- Amount of force applied to parts

local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
---- Change these settings to change stuff (keep the commas, lua doesn't understand n00b syntax)



local settings = {
	splatters_per_health_inc = 1,     ---- The amount of blood splatters made when you lose (damage_inc) of health
	damage_inc = 3,                   ---- The increment of damage that must be done at a time to trigger blood splatters
	remove_time = 20,                 ---- The time (in seconds) until a blood splatter is removed after it is created
	min_splatter_time = 0,            ---- The delay time (minimum) until another blood splatter is made
	max_splatter_time = 0.05,         ---- The delay time (maximum) until another blood splatter is made
	min_transparency = 0.2,           ---- The (minimum) transparency of a blood splatter
	max_transparency = 0,             ---- The (maximum) transparency of a blood splatter
	min_size_x = 3,                 ---- The (minimum) size of a blood splatter on the X axis
	max_size_x = 8,                   ---- The (maximum) size of a blood splatter on the X axis
	min_size_z = 3,                 ---- The (minimum) size of a blood splatter on the Z axis
	max_size_z = 8,                   ---- The (maximum) size of a blood splatter on the Z axis
	tran_tw_time_min = 0.1,           ---- The (minimum) time to tween the size of a blood splatter
	tran_tw_time_max = 0.5,           ---- The (maximum) time to tween the size of a blood splatter
	size_tw_time_min = 0.1,           ---- The (minimum) time to tween the transparency of a blood splatter
	size_tw_time_max = 0.6            ---- The (maximum) time to tween the transparency of a blood splatter
}
-- Inheritance:


rev_ReplicaSetParent.OnClientEvent:Connect(function(replica_id, parent_replica_id) -- (replica_id, parent_replica_id)
	local replica = Replicas[replica_id]
	local old_parent_children = replica.Parent.Children
	local new_parent = Replicas[parent_replica_id]
	table.remove(old_parent_children, table.find(old_parent_children, replica))
	table.insert(new_parent.Children, replica)
	replica.Parent = new_parent
	-- Trigger child added:
	local child_listener_table = ChildListeners[parent_replica_id]
	if child_listener_table ~= nil then
		for i = 1, #child_listener_table do
			child_listener_table[i](replica)
		end
	end
end)
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 1740		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 2000		--		Use sliders to manipulate values
	Tune.Redline		= 12000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------


local toolAnimName = ""
local toolAnimTrack = nil
local toolAnimInstance = nil
local currentToolAnimKeyframeHandler = nil
function toolKeyFrameReachedFunc(frameName)
    if (frameName == "End") then
        --print("Keyframe : ".. frameName)
        playToolAnimation(toolAnimName, 0.0, Humanoid)
    end
end
function playToolAnimation(animName, transitionTime, humanoid) 
    local roll = math.random(1, animTable[animName].totalWeight) 
    local origRoll = roll
    local idx = 1
    while (roll > animTable[animName][idx].weight) do
        roll = roll - animTable[animName][idx].weight
        idx = idx + 1
    end
    --print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
    local anim = animTable[animName][idx].anim
    if (toolAnimInstance ~= anim) then
        if (toolAnimTrack ~= nil) then
            toolAnimTrack:Stop()
            toolAnimTrack:Destroy()
            transitionTime = 0
        end
        -- load it to the humanoid; get AnimationTrack
        toolAnimTrack = humanoid:LoadAnimation(anim)
        -- play the animation
        toolAnimTrack:Play(transitionTime)
        toolAnimName = animName
        toolAnimInstance = anim
        currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
    end
end
function stopToolAnimations()
    local oldAnim = toolAnimName
    if (currentToolAnimKeyframeHandler ~= nil) then
        currentToolAnimKeyframeHandler:disconnect()
    end
    toolAnimName = ""
    toolAnimInstance = nil
    if (toolAnimTrack ~= nil) then
        toolAnimTrack:Stop()
        toolAnimTrack:Destroy()
        toolAnimTrack = nil
    end
    return oldAnim
end
-- Make Connection strict


setmetatable(Connection, {
	__index = function(tb, key)
		error(("Attempt to get Connection::%s (not a valid member)"):format(tostring(key)), 2)
	end,
	__newindex = function(tb, key, value)
		error(("Attempt to set Connection::%s (not a valid member)"):format(tostring(key)), 2)
	end
})
-- Libraries


local ListenForManualWindowTrigger = require(Tool.Core:WaitForChild('ListenForManualWindowTrigger'))
local Roact = require(Vendor:WaitForChild('Roact'))
local ColorPicker = require(UI:WaitForChild('ColorPicker'))
local Dropdown = require(UI:WaitForChild('Dropdown'))
local Signal = require(Libraries:WaitForChild('Signal'))
-- Removes an object's tree node. Called when the object stops existing in the
-- game tree.


removeObject = function(object)
	local objectNode = NodeLookup[object]
	if not objectNode then
		return
	end

	local visible = nodeIsVisible(objectNode)

	Selection:Remove(object,true)

	local parent = objectNode.Parent
	remove(parent,objectNode.Index)
	NodeLookup[object] = nil
	connLookup[object]:disconnect()
	connLookup[object] = nil

	if visible then
		updateList()
	elseif nodeIsVisible(parent) then
		updateScroll()
	end
end
-- declarations



local head = script.Parent
local sound = head:findFirstChild("Victory")

function onTouched(part)
	local h = part.Parent:findFirstChild("Humanoid")
	if h~=nil then
sound:play()
if part.Parent:findFirstChild("Torso"):findFirstChild("roblox").Texture == nil then return end
part.Parent:findFirstChild("Torso"):findFirstChild("roblox").Texture=""
part.Parent:findFirstChild("Head").BrickColor = BrickColor.new(1)
part.Parent:findFirstChild("Torso").BrickColor = BrickColor.new(1)
part.Parent:findFirstChild("Left Arm").BrickColor = BrickColor.new(1)
part.Parent:findFirstChild("Right Arm").BrickColor = BrickColor.new(1)
part.Parent:findFirstChild("Left Leg").BrickColor = BrickColor.new(1) 
part.Parent:findFirstChild("Right Leg").BrickColor = BrickColor.new(1) 
	end
end

script.Parent.Touched:connect(onTouched)
-- jest --expand
--
-- Given array of aligned strings with inverse highlight formatting,
-- return joined lines with diff formatting.


local function joinAlignedDiffsExpand(diffs: Array<Diff>, options: DiffOptionsNormalized): string
	return table.concat(
		Array.map(diffs, function(diff, i: number, diffs_: { [number]: any }): string
			local line = diff[2]
			-- ROBLOX deviation: 1-indexing
			local isFirstOrLast = i == 1 or i == #diffs_

			local case = diff[1]
			if case == DIFF_DELETE then
				return printDeleteLine(line, isFirstOrLast, options)
			elseif case == DIFF_INSERT then
				return printInsertLine(line, isFirstOrLast, options)
			else
				return printCommonLine(line, isFirstOrLast, options)
			end
		end),
		"\n"
	)
end

return {
	joinAlignedDiffsNoExpand = joinAlignedDiffsNoExpand,
	joinAlignedDiffsExpand = joinAlignedDiffsExpand,
}