const skills = require('./data/skills');
const inkipediaGear = require('./data/inkipediaGear');

function getOriginalGear(gear) {
    if (!gear)
        return;

    let originalGear = inkipediaGear[gear.kind].find(ig => ig.name == gear.name);

    if (!originalGear)
        return;

    return Object.assign({}, originalGear, { skill: skills[originalGear.skill] });
}

module.exports = {
    getOriginalGear,
}

const skills = require('./data/skills');
const inkipediaGear = require('./data/inkipediaGear');

function getOriginalGear(gear) {
    if (!gear || !gear.name)
        return;

    let name = gear.name.toLowerCase().trim();

    let originalGear = inkipediaGear[gear.kind].find(ig => ig.name.toLowerCase() == name);

    if (!originalGear)
        return;

    return Object.assign({}, originalGear, { skill: skills[originalGear.skill] });
}

module.exports = {
    getOriginalGear,
}

Improve original SplatNet gear name matching
Improve original SplatNet gear name matching

There was an item with the name "Annaki Drive Tee " (with an extra space at the end) which didn't match the Inkipedia data. This change also makes the comparison case insensitive just in case.