Title: `repl` param of `string.gsub` seems to be incorrect · Issue #52 · TypeScriptToLua/lua-types · GitHub
Open Graph Title: `repl` param of `string.gsub` seems to be incorrect · Issue #52 · TypeScriptToLua/lua-types
X Title: `repl` param of `string.gsub` seems to be incorrect · Issue #52 · TypeScriptToLua/lua-types
Description: The types say: repl: string | Record
Open Graph Description: The types say: repl: string | Record
X Description: The types say: repl: string | Record<string, string> | ((...matches: string[]) => string),, whereas the above docstring says: "otherwise, if it is false or nil, then there is no repla...
Opengraph URL: https://github.com/TypeScriptToLua/lua-types/issues/52
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`repl` param of `string.gsub` seems to be incorrect","articleBody":"The types say: `repl: string | Record\u003cstring, string\u003e | ((...matches: string[]) =\u003e string),`, whereas the above docstring says: \"otherwise, if it is false or nil, then there is no replacement\" - therefore, this should be an optional string, as it may be `nil`.\r\n\r\nFurthermore, I believe a `()` capture group will return an `index`, so the matches aren't even necessarily a `string[]`, but may be either `number` or `string`. `gmatch` etc might have similar issues.\r\n\r\nYou should maybe declare a `match` type which may be either a `number` or a `string`.","author":{"url":"https://github.com/appgurueu","@type":"Person","name":"appgurueu"},"datePublished":"2022-02-12T21:01:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/52/lua-types/issues/52"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fed1e79b-b0fb-9d2c-8b3a-fd4f1a888f31 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CFFC:3050FD:3EE5FD:5537A6:6971B5DA |
| html-safe-nonce | 6ac8c34ff427324ec26574b68ae2123e80f76025fcdf1abadfeb19fc37923ea5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkZDOjMwNTBGRDozRUU1RkQ6NTUzN0E2OjY5NzFCNURBIiwidmlzaXRvcl9pZCI6Ijg2NzMwMzE5NTAyNjk3ODk2NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cf456ba12f397a7f298def2c80cd838d13fcce057012c3ef67571873acbfabbc |
| hovercard-subject-tag | issue:1134605727 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TypeScriptToLua/lua-types/52/issue_layout |
| twitter:image | https://opengraph.githubassets.com/43a6971c425a00004d7a844f324900101e408c77af73382ab3f1abbfee6d3cb6/TypeScriptToLua/lua-types/issues/52 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/43a6971c425a00004d7a844f324900101e408c77af73382ab3f1abbfee6d3cb6/TypeScriptToLua/lua-types/issues/52 |
| og:image:alt | The types say: repl: string | Record |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | appgurueu |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3b677fea7de290a6c0d1c9ccd6c9909b6a527cf8ee079649e09dc78092d24f1 |
| turbo-cache-control | no-preview |
| go-import | github.com/TypeScriptToLua/lua-types git https://github.com/TypeScriptToLua/lua-types.git |
| octolytics-dimension-user_id | 44121206 |
| octolytics-dimension-user_login | TypeScriptToLua |
| octolytics-dimension-repository_id | 116213653 |
| octolytics-dimension-repository_nwo | TypeScriptToLua/lua-types |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 116213653 |
| octolytics-dimension-repository_network_root_nwo | TypeScriptToLua/lua-types |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 29d7fcca69cafb91ec8a596aaf222fd46e9bc934 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width