How to use the oni-save-parser.getHashedString function in oni-save-parser

To help you get started, we’ve selected a few oni-save-parser 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 RoboPhred / oni-duplicity / src / pages / DuplicantEditorPage / components / DuplicantEditor / components / Interests / Interests.tsx View on Github external
function aptitudeValue(
  aptitudes: [HashedString, number][],
  aptitudeName: string
): number {
  const hash = getHashedString(aptitudeName).hash;
  const aptitude = find(aptitudes, x => x[0].hash === hash);
  if (!aptitude) {
    return 0;
  }
  return aptitude[1];
}
github RoboPhred / oni-duplicity / src / pages / DuplicantEditorPage / components / DuplicantEditor / components / Interests / Interests.tsx View on Github external
function removeAptitude(aptitudeName: string) {
    const hashStr = getHashedString(aptitudeName);
    const index = findIndex(
      AptitudeBySkillGroup,
      x => x[0].hash === hashStr.hash
    );
    if (index === -1) {
      return;
    }
    onTemplateDataModify({
      AptitudeBySkillGroup: [
        ...AptitudeBySkillGroup.slice(0, index),
        ...AptitudeBySkillGroup.slice(index + 1)
      ]
    });
  }