Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 300 Bytes

README.md

File metadata and controls

19 lines (17 loc) · 300 Bytes

switch.lua

Lua implementation of a switch statement. Supports an optional default case.

Example

local switch = require 'switch'

switch('lua', {
  goodbye = function(value)
    ...
  end,
  hello = function(value)
    ...
  end,
  [switch.default] = function(value)
    ...
  end
})