type-fns
Version:
A set of types, type checks, and type guards for simpler, safer, and easier to read code.
18 lines • 706 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
describe('Literalize', () => {
it('should be able to cast enum into union of literals or enum values', () => {
let Berry;
(function (Berry) {
Berry["RASPBERRY"] = "raspberry";
Berry["STRAWBERRY"] = "strawberry";
Berry["BLUEBERRY"] = "blueberry";
})(Berry || (Berry = {}));
// @ts-expect-error // 🛑 Type '"raspberry"' is not assignable to type 'Berries'.ts(2322)
const before = 'raspberry';
// after
const literally = 'raspberry';
const originally = Berry.STRAWBERRY;
});
});
//# sourceMappingURL=Literalize.test.js.map