mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
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.
15 lines
470 B
JavaScript
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 = {}));
|