Skip to content

typesVersions redirect is off-by-one for <= and > #40113

Closed
@sandersn

Description

@sandersn

package.json with the following entry:

  "typesVersions": {
    "<=3.9.0-0": {
      "*": [
        "ts3.9/*"
      ]
    }
  },

Expected behavior:

TS 3.9 (and 3.8, 3.7, ...) should use ts3.9/index.d.ts; TS 4.0 should use index.d.ts

Actual behavior:

TS 3.9 (and 4.0, 4.1) use index.d.ts; TS 3.8, 3.7, ... use ts3.9/index.d.ts.

I wrote a unit test and the same off-by-one error exists for >.

Note: doesn't repro without the trailing '-0', eg <=3.9.0. I'm not sure what this means or why Definitely Typed's package.json uses it.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions