Skip to content

Fix string.find and string.match from unexpected explosions #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/5.0/string.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ declare namespace string {
pattern: string,
init?: number,
plain?: boolean
): LuaMultiReturn<[number, number, ...string[]] | []>;
): LuaMultiReturn<[number?, number?, ...string[]] | []>;

/**
* Returns a formatted version of its variable number of arguments following
Expand Down
4 changes: 2 additions & 2 deletions core/string.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare namespace string {
pattern: string,
init?: number,
plain?: boolean
): LuaMultiReturn<[number, number, ...string[]] | []>;
): LuaMultiReturn<[number?, number?, ...string[]] | []>;

/**
* Returns a formatted version of its variable number of arguments following
Expand Down Expand Up @@ -177,7 +177,7 @@ declare namespace string {
* returned. A third, optional numeric argument init specifies where to start
* the search; its default value is 1 and can be negative.
*/
function match(s: string, pattern: string, init?: number): LuaMultiReturn<string[]>;
function match(s: string, pattern: string, init?: number): LuaMultiReturn<[string[] | null]>;

/**
* Returns a string that is the concatenation of `n` copies of the string `s`.
Expand Down