Skip to content

Commit 6e497c4

Browse files
committed
feat(global): use assertion signature for assert
1 parent 29e94b0 commit 6e497c4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

core/global.d.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@ declare const _VERSION: 'Lua 5.1' | 'Lua 5.2' | 'Lua 5.3' | 'Lua 5.4';
2525
declare const _G: typeof globalThis;
2626

2727
/**
28-
* Calls error if the value of its argument v is false (i.e., nil or false);
29-
* otherwise, returns all its arguments. In case of error, message is the error
30-
* object; when absent, it defaults to "assertion failed!"
31-
* @tupleReturn
28+
* Calls error if the value of its argument `v` is false (i.e., nil or false);
29+
* otherwise, returns all its arguments. In case of error, `message` is the
30+
* error object; when absent, it defaults to "assertion failed!"
3231
*/
33-
declare function assert<T extends any[]>(
34-
...args: T
35-
): { [P in keyof T]: P extends '0' ? Exclude<T[P], false | null | undefined> : T[P] };
32+
declare function assert(v: any, message?: string): asserts v;
3633

3734
/**
3835
* This function is a generic interface to the garbage collector. It performs

0 commit comments

Comments
 (0)