From 616b31b35f4036448042bf8362069c56454e29c4 Mon Sep 17 00:00:00 2001 From: Max Cahill <1bardesign@gmail.com> Date: Sun, 9 Aug 2020 19:49:24 +1000 Subject: [PATCH] [fixed] missing exports for some aliases, simplified export --- init.lua | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/init.lua b/init.lua index c1ea943..14cd44d 100644 --- a/init.lua +++ b/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