mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-10 02:31:48 +00:00
[fixed] missing exports for some aliases, simplified export
This commit is contained in:
parent
b4e2cff498
commit
616b31b35f
36
init.lua
36
init.lua
@ -51,11 +51,12 @@ end
|
||||
|
||||
--easy export globally if required
|
||||
function _batteries:export()
|
||||
--export oo
|
||||
class = self.class
|
||||
|
||||
--export assert
|
||||
assert = self.assert
|
||||
--export all key strings globally, if doesn't always exist
|
||||
for k, v in pairs(self) do
|
||||
if not _G[k] then
|
||||
_G[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
--overlay tablex and functional and sort routines onto table
|
||||
self.tablex.overlay(table, self.tablex)
|
||||
@ -63,37 +64,12 @@ function _batteries:export()
|
||||
table.overlay(table, self.functional)
|
||||
self.sort:export()
|
||||
|
||||
--functional module also available separate from table
|
||||
functional = self.functional
|
||||
|
||||
--export collections
|
||||
sequence = self.sequence
|
||||
set = self.set
|
||||
|
||||
--overlay onto global math table
|
||||
table.overlay(math, self.mathx)
|
||||
|
||||
--overlay onto string
|
||||
table.overlay(string, self.stringx)
|
||||
|
||||
--export geom
|
||||
vec2 = self.vec2
|
||||
vec3 = self.vec3
|
||||
intersect = self.intersect
|
||||
|
||||
--"misc" :)
|
||||
unique_mapping = self.unique_mapping
|
||||
state_machine = self.state_machine
|
||||
async = self.async
|
||||
manual_gc = self.manual_gc
|
||||
|
||||
--support both spellings
|
||||
colour = self.colour
|
||||
color = self.colour
|
||||
|
||||
--export top level module as well for ease of migration for code
|
||||
batteries = self
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user