7 lines
2.2 KiB
Lua
7 lines
2.2 KiB
Lua
|
-- Penlight 1.11.0-1 | /lua/pl/import_into.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.
|
||
|
return function(a)local b;if a==true then b={}a={}end;local a=a or{}local c={utils=true,path=true,dir=true,tablex=true,stringio=true,sip=true,input=true,seq=true,lexer=true,stringx=true,config=true,pretty=true,data=true,func=true,text=true,operator=true,lapp=true,array2d=true,comprehension=true,xml=true,types=true,test=true,app=true,file=true,class=true,luabalanced=true,permute=true,template=true,url=true,compat=true,List=true,Map=true,Set=true,OrderedMap=true,MultiMap=true,Date=true}rawset(a,'utils',require'pl.utils')for d,e in pairs(a.utils.stdmt)do e.__index=function(f,g)return require('pl.'..d)[g]end end;local h,i;local j={}local k=getmetatable(a)if k then i=k.__index;if k.__newindex then j.__index=k.__newindex end end;function j.hook(l)h=l end;function j.__index(f,d)local m=c[d]if m then rawset(a,d,require('pl.'..d))return a[d]else local n;if h then n=h(f,d)if n then return n end end;if i then return i(f,d)end end end;if b then function j.__newindex(f,d,o)b[d]=o;rawset(f,d,o)end end;setmetatable(a,j)return a,b or a end
|