@jswork/next-get-key

1.0.0 • Public • Published

next-get-key

Get key by value.

version license size download

installation

npm install -S @jswork/next-get-key

usage

import '@jswork/next-get-key';

const status = {
  error: -1,
  init: 0,
  play: 1,
  pause: 2,
  loaded: 3,
  ended: 4,
};

nxGetKey(status, -1);   // 'error'
nxGetKey(status, 0);    // 'init'
nxGetKey(status, 1);    // 'play'
nxGetKey(status, 2);    // 'pause'
nxGetKey(status, 3);    // 'loaded'
nxGetKey(status, 4);    // 'ended'

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/next-get-key

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.62 kB

Total Files

5

Last publish

Collaborators

  • afeiship