UNPKG
enum8
Version:
latest (1.0.6)
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
The way to create enums in JavaScript and TypeScript
github.com/dominicvonk/enum8
dominicvonk/enum8
enum8
/
dist
/
main.js
7 lines
•
235 B
JavaScript
View Raw
1
2
3
4
5
6
7
export
function
enumerate
(
record
) {
if
(
Array
.
isArray
(record)) {
return
Object
.
freeze
(
Object
.
fromEntries
(record.
map
(
(
key, index
) =>
[key, index]))); }
return
Object
.
freeze
(record); }
//# sourceMappingURL=main.js.map