UNPKG

read-gedcom

Version:
27 lines 765 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseNameParts = void 0; // eslint-disable-next-line const rNameParts = /^(?:([^\/]*)|(?:(?:([^\/]*?) ?)?\/([^\/]*)\/(?: ?([^\/]*))?))$/; /** * Parses a name value into three potentially undefined name parts. * @param value The value to parse * @category Value parsers */ const parseNameParts = (value) => { if (!value) { return null; } const groups = rNameParts.exec(value); if (!groups) { return null; } if (groups[1] === undefined) { return [groups[2], groups[3], groups[4]]; } else { return [groups[1], undefined, undefined]; } }; exports.parseNameParts = parseNameParts; //# sourceMappingURL=name.js.map