index.js 347 B

12345678910111213141516171819
  1. var constants = exports;
  2. // Helper
  3. constants._reverse = function reverse(map) {
  4. var res = {};
  5. Object.keys(map).forEach(function(key) {
  6. // Convert key to integer if it is stringified
  7. if ((key | 0) == key)
  8. key = key | 0;
  9. var value = map[key];
  10. res[value] = key;
  11. });
  12. return res;
  13. };
  14. constants.der = require('./der');