Sha256: f2c22473d3b6035306cf483364b2ac63d18f7b9a19d21e6daa6a50f3340f0a2f
Contents?: true
Size: 719 Bytes
Versions: 11
Compression:
Stored size: 719 Bytes
Contents
((exports) => { const getCategory = (category) => { let defaultCat = { color: getComputedStyle(document.documentElement).getPropertyValue('--primary'), children: () => {}, parent: null, name: null }; if(category) { let id = category.id ? parseInt(category.id, 10) : parseInt(category, 10); let cat = exports.AwesomeMap.categories.find((c) => c.id == id); if(cat) { cat.children = () => { return exports.AwesomeMap.categories.filter((c) => c.parent === cat.id ); } return cat; } } return defaultCat; }; exports.AwesomeMap = exports.AwesomeMap || {}; exports.AwesomeMap.getCategory = getCategory; })(window);
Version data entries
11 entries across 11 versions & 1 rubygems