How to use the girlsfrontline-core.equips.map function in girlsfrontline-core

To help you get started, we’ve selected a few girlsfrontline-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 36base / 36base.github.io / src / repositories / EquipRepository.js View on Github external
default: color = '#ffcd4a'; break;
  }

  return color;
};

const buildData = equip => Object.assign(
  equip,
  {
    buildTime: ((equip.fitGuns || equip.company === '16Lab') ? 0 : equip.buildTime),
    color: getColor(equip.rank),
    alias: equipAlias[equip.id] || [],
  },
);

const equipMap = new Map(equips.map(e => [e.id, e]));

const getAll = () => {
  const equipDict = {};

  equipMap.forEach((e, id) => {
    equipDict[id] = buildData(new Equip(e.toJSON()));
  });

  return equipDict;
};

const getNewById = (id) => {
  const equip = equipMap.get(id);
  if (!equip) { return null; }

  return buildData(new Equip(equip.toJSON()));

girlsfrontline-core

GirlsFrontline Library

MIT
Latest version published 2 years ago

Package Health Score

49 / 100
Full package analysis

Similar packages