Files
scriptc/tests/fixtures/npm/node_modules/tscenumreverse/build/index.js
T
Chris Tate b04166a8f0 Read runtime keys of package enum objects as checked-dynamic values
The enum rewrite turns a package's numeric enum into one object holding
its names and its reverse mapping, so the object's fields have different
types. A reverse read with a runtime key, such as
DiagLogLevel[DiagLogLevel.WARN] in @opentelemetry/api, then failed with
SC1090 ("the declared fields have no one common type").

A keyed read of such a record already answers a checked-dynamic value in
JavaScript files. It now does the same where the checker types the read
'any'. The new npm case tsc-enum-reverse-reads matches Node, as does the
opentelemetry-api case again.
2026-10-20 20:04:06 -05:00

15 lines
470 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Kind = exports.Level = void 0;
var Level;
(function (Level) {
Level[Level["NONE"] = 0] = "NONE";
Level[Level["WARN"] = 30] = "WARN";
Level[Level["DEBUG"] = 60] = "DEBUG";
})(Level || (exports.Level = Level = {}));
var Kind;
(function (Kind) {
Kind[Kind["SERVER"] = 0] = "SERVER";
Kind[Kind["CLIENT"] = 1] = "CLIENT";
})(Kind = exports.Kind || (exports.Kind = {}));