Replace tableshape with lua_shape for metafunction schema:
- Convert ts.shape to T.table
- Convert ts.func to T.callable()
- Convert ts.array_of to T.array
- Convert :is_optional() to :optional()
No functional changes, luacheck passes.
local exports = {}
local N = "metatokens"
-local ts = require("tableshape").types
+local T = require "lua_shape.core"
local logger = require "rspamd_logger"
local lua_mime = require "lua_mime"
},
}
-local meta_schema = ts.shape {
- cb = ts.func,
- ninputs = ts.number,
- names = ts.array_of(ts.string),
- description = ts.string:is_optional()
-}
+local meta_schema = T.table({
+ cb = T.callable(),
+ ninputs = T.number(),
+ names = T.array(T.string()),
+ description = T.string():optional()
+})
local metatokens_by_name = {}