diff --git a/lib/init.lua b/lib/init.lua index 2953c3a..d68ccc8 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -50,6 +50,15 @@ end **--]] t.boolean = t.typeof("boolean") +--[[** + ensures Lua primitive buffer type + + @param value The value to check against + + @returns True iff the condition is satisfied, false otherwise +**--]] +t.buffer = t.typeof("buffer") + --[[** ensures Lua primitive thread type @@ -106,6 +115,15 @@ t.table = t.typeof("table") **--]] t.userdata = t.type("userdata") +--[[** + ensures Lua primitive vector type + + @param value The value to check against + + @returns True iff the condition is satisfied, false otherwise +**--]] +t.vector = t.typeof("vector") + --[[** ensures value is a number and non-NaN diff --git a/lib/t.d.ts b/lib/t.d.ts index f9f46df..97fdd3c 100644 --- a/lib/t.d.ts +++ b/lib/t.d.ts @@ -12,6 +12,8 @@ interface t { any: t.check; /** checks to see if `value` is a boolean */ boolean: t.check; + /** checks to see if `value` is a buffer */ + buffer: t.check; /** checks to see if `value` is a thread */ thread: t.check; /** checks to see if `value` is a function */ @@ -32,6 +34,8 @@ interface t { table: t.check; /** checks to see if `value` is a userdata */ userdata: t.check; + /** checks to see if `value` is a vector (Vector3 in Roblox) */ + vector: t.check; // roblox types /** checks to see if `value` is an Axes */ diff --git a/lib/ts.lua b/lib/ts.lua index fb594a3..d2eebd2 100644 --- a/lib/ts.lua +++ b/lib/ts.lua @@ -50,6 +50,15 @@ end **--]] t.boolean = t.typeof("boolean") +--[[** + ensures Lua primitive buffer type + + @param value The value to check against + + @returns True iff the condition is satisfied, false otherwise +**--]] +t.buffer = t.typeof("buffer") + --[[** ensures Lua primitive thread type @@ -106,6 +115,15 @@ t.table = t.typeof("table") **--]] t.userdata = t.type("userdata") +--[[** + ensures Lua primitive vector type + + @param value The value to check against + + @returns True iff the condition is satisfied, false otherwise +**--]] +t.vector = t.typeof("vector") + --[[** ensures value is a number and non-NaN