gedcom-ts
Version:
A TypeScript library to create genealogy tree data model and to import/export data in a GEDCOM file (.ged).
10 lines (9 loc) • 384 B
JavaScript
export const findValueInLine = (lines, keyword) => {
const line = lines.find((lineInformation) => lineInformation.startsWith(keyword));
return line ? line.replace(keyword, '') : null;
};
export const findLinesConcernedByKeyword = (lines, keyword) => {
return [...lines]
.filter(line => line.startsWith(keyword))
.map(line => line.replace(keyword, ''));
};