mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
refactor: code quality
This commit is contained in:
parent
f0a7938703
commit
8ca299f671
16 changed files with 82 additions and 101 deletions
|
|
@ -1,4 +1,4 @@
|
|||
local isAtom = require(script.Parent.Parent.isAtom)
|
||||
local store = require(script.Parent.Parent.store)
|
||||
|
||||
local SAFE_KEYS = { string = true, number = true }
|
||||
local SAFE_VALUES = { string = true, number = true, boolean = true, table = true }
|
||||
|
|
@ -40,7 +40,7 @@ local function validate(value: any, key: any)
|
|||
elseif typeOfValue == "table" then
|
||||
if getmetatable(value) ~= nil then
|
||||
error(`Cannot sync tables with metatables! Got {value} at key '{key}'`)
|
||||
elseif isAtom(value) then
|
||||
elseif store.isAtom(value) then
|
||||
error(`Cannot sync nested atoms! Got atom '{value.debugLabel}' at key '{key}'`)
|
||||
elseif isUnsafeTable(value) then
|
||||
error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue