mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2024-12-25 15:52:27 +01:00
35966b2007
base64 inspect json.lua Lua-hashings Lua-nums Moses mt19937ar-lua Penlight Serpent
7 lines
1.7 KiB
Lua
7 lines
1.7 KiB
Lua
-- Penlight 1.11.0-1 | /lua/pl/MultiMap.lua | https://github.com/lunarmodules/Penlight | License: MIT | Minified using https://www.npmjs.com/package/luamin/v/1.0.4
|
|
-- Copyright (C) 2009-2016 Steve Donovan, David Manura.
|
|
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
local a=require'pl.utils'local b=require'pl.class'local c=require'pl.List'local d=require'pl.Map'local e=a.stdmt.MultiMap;b(d,nil,e)e._name='MultiMap'function e:_init(f)if not f then return end;self:update(f)end;function e:update(f)a.assert_arg(1,f,'table')if d:class_of(f)then for g,h in pairs(f)do self[g]=c()self[g]:append(h)end else for g,h in pairs(f)do self[g]=c(h)end end end;function e:set(i,j)if j==nil then self[i]=nil else if not self[i]then self[i]=c()end;self[i]:append(j)end end;return e
|