Nitrogenous Polymorphic Molecule

    key-by-val

    1.0.0 • Public • Published

    key-by-val

    tiny fn I seem to find myself needing often

    var kByV = require('key-by-val')
    var consts = {
      public: 1,
      private: 2,
      happy: 3
    }
     
    var blah = {
      type: 3  
    }
     
    var typeName = kByV(consts, blah.type) // === 'happy'

    Install

    npm i key-by-val

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • tenaciousmv
    • pgmemk
    • genevayngrib