GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `repl` param of `string.gsub` seems to be incorrect · Issue #52 · TypeScriptToLua/lua-types

repl param of string.gsub seems to be incorrect #52

New issue
Copy link
New issue
Copy link
Open
Open
repl param of string.gsub seems to be incorrect#52
Copy link

Description

@appgurueu
appgurueu
opened on Feb 12, 2022
Issue body actions

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 replacement" - therefore, this should be an optional string, as it may be nil.

Furthermore, 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.

You should maybe declare a match type which may be either a number or a string.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.