mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
22 lines
368 B
JavaScript
22 lines
368 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const constants = exports;
|
||
|
|
||
|
// Helper
|
||
|
constants._reverse = function reverse(map) {
|
||
|
const res = {};
|
||
|
|
||
|
Object.keys(map).forEach(function(key) {
|
||
|
// Convert key to integer if it is stringified
|
||
|
if ((key | 0) == key)
|
||
|
key = key | 0;
|
||
|
|
||
|
const value = map[key];
|
||
|
res[value] = key;
|
||
|
});
|
||
|
|
||
|
return res;
|
||
|
};
|
||
|
|
||
|
constants.der = require('./der');
|