JSPM

enum-keys-values-entries

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 173
  • Score
    100M100P100Q88046F
  • License ISC

Get just the keys (left hand side), values (right hand side), or entries (tuple of [key, value]) of a TypeScript enum

Package Exports

  • enum-keys-values-entries
  • enum-keys-values-entries/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (enum-keys-values-entries) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

enum-keys-values-entries

Get just the keys (left hand side), values (right hand side), or entries (tuple of [key, value]) of a TypeScript enum.

GitHub release Build Status codecov Codacy Badge

Install

You can install via npm or yarn.

npm

npm install --save enum-keys-values-entries

yarn

yarn add enum-keys-values-entries

Usage

Keys

import { Enum } from 'enum-keys-values-entries';

enum MyEnum {
  Cake = 1,
  'Ice Cream' = 2,
  Pie = 3,
}

const keys = Enum.keys(MyEnum);
const values = Enum.values(MyEnum);
const entries = Enum.entries(MyEnum);