Skip to content

Commit 2358f50

Browse files
committed
Okay now we handle defaulting the base table properly
1 parent b6c99db commit 2358f50

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

docs/api/nfnl/module.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ Looks up the mod-name in package.loaded, if it's the same type as base it'll
4545
changes will be reflected in all other modules that depend on this one
4646
without having to reload the dependant modules.
4747

48-
If the currently loaded value _and_ the base value are both nil then an empty
49-
table is used by default.
48+
The base value defaults to {}, an empty table.
5049

5150

5251
<!-- Generated with Fenneldoc v1.0.1

fnl/nfnl/module.fnl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,11 @@
5555
changes will be reflected in all other modules that depend on this one
5656
without having to reload the dependant modules.
5757
58-
If the currently loaded value _and_ the base value are both nil then an empty
59-
table is used by default."
58+
The base value defaults to {}, an empty table."
6059

6160
(let [loaded (. package.loaded mod-name)]
62-
(if
63-
(and (= nil loaded base))
64-
{}
65-
66-
(= (type loaded) (type base))
61+
(if (= (type loaded) (type base))
6762
loaded
68-
69-
base)))
63+
(or base {}))))
7064

7165
M

lua/nfnl/module.lua

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)