Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added support for array.find#730

Merged
Perryvw merged 2 commits into
masterTypeScriptToLua/TypeScriptToLua:masterfrom
feature/array-findTypeScriptToLua/TypeScriptToLua:feature/array-findCopy head branch name to clipboard
Oct 5, 2019
Merged

Added support for array.find#730
Perryvw merged 2 commits into
masterTypeScriptToLua/TypeScriptToLua:masterfrom
feature/array-findTypeScriptToLua/TypeScriptToLua:feature/array-findCopy head branch name to clipboard

Conversation

@Perryvw

@Perryvw Perryvw commented Oct 3, 2019

Copy link
Copy Markdown
Member

Somehow we missed this and never noticed, but now it's in.

Comment thread src/lualib/ArrayFind.ts Outdated
@@ -0,0 +1,14 @@
// https://www.ecma-international.org/ecma-262/10.0/index.html#sec-array.prototype.find
function __TS__ArrayFind<T>(this: void, arr: T[], callbackFn: (element: T, index?: number, array?: T[]) => boolean): T {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function __TS__ArrayFind<T>(this: void, arr: T[], callbackFn: (element: T, index?: number, array?: T[]) => boolean): T {
function __TS__ArrayFind<T>(this: void, arr: T[], callbackFn: (element: T, index: number, array: T[]) => unknown): T {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the return type should probably be T | undefined

@Perryvw Perryvw merged commit de818bc into master Oct 5, 2019
@Perryvw Perryvw deleted the feature/array-find branch October 5, 2019 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.