mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 15:16:14 +00:00
Run prettier on all code
This commit is contained in:
@@ -3,9 +3,13 @@ import {analyticsEvent} from '../util/analytics';
|
|||||||
import {TopolaError} from '../util/error';
|
import {TopolaError} from '../util/error';
|
||||||
import {normalizeGedcom, TopolaData} from '../util/gedcom_util';
|
import {normalizeGedcom, TopolaData} from '../util/gedcom_util';
|
||||||
import {DataSource, DataSourceEnum, SourceSelection} from './data_source';
|
import {DataSource, DataSourceEnum, SourceSelection} from './data_source';
|
||||||
import {loadData, PRIVATE_ID_PREFIX} from './wikitree_api';
|
|
||||||
import {convertFams, convertIndis, convertPersonNames} from './wikitree_transformer';
|
|
||||||
import {buildGedcom} from './gedcom_generator';
|
import {buildGedcom} from './gedcom_generator';
|
||||||
|
import {loadData, PRIVATE_ID_PREFIX} from './wikitree_api';
|
||||||
|
import {
|
||||||
|
convertFams,
|
||||||
|
convertIndis,
|
||||||
|
convertPersonNames,
|
||||||
|
} from './wikitree_transformer';
|
||||||
|
|
||||||
export {PRIVATE_ID_PREFIX};
|
export {PRIVATE_ID_PREFIX};
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,10 @@ async function getAllDescendants(key: string, handleCors: boolean) {
|
|||||||
* @param authcode Optional authentication code.
|
* @param authcode Optional authentication code.
|
||||||
* @returns A unique list of WikiTree `Person` records.
|
* @returns A unique list of WikiTree `Person` records.
|
||||||
*/
|
*/
|
||||||
export async function loadData(key: string, authcode?: string): Promise<Person[]> {
|
export async function loadData(
|
||||||
|
key: string,
|
||||||
|
authcode?: string,
|
||||||
|
): Promise<Person[]> {
|
||||||
// Work around CORS if not in apps.wikitree.com domain.
|
// Work around CORS if not in apps.wikitree.com domain.
|
||||||
const handleCors = window.location.hostname !== 'apps.wikitree.com';
|
const handleCors = window.location.hostname !== 'apps.wikitree.com';
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
import {IntlShape} from 'react-intl';
|
import {IntlShape} from 'react-intl';
|
||||||
import {
|
import {DateOrRange, JsonEvent, JsonFam, JsonImage, JsonIndi} from 'topola';
|
||||||
DateOrRange,
|
|
||||||
JsonEvent,
|
|
||||||
JsonFam,
|
|
||||||
JsonImage,
|
|
||||||
JsonIndi,
|
|
||||||
} from 'topola';
|
|
||||||
import {StringUtils} from 'turbocommons-ts';
|
import {StringUtils} from 'turbocommons-ts';
|
||||||
import {Person} from 'wikitree-js';
|
import {Person} from 'wikitree-js';
|
||||||
import {PRIVATE_ID_PREFIX} from './wikitree_api';
|
import {PRIVATE_ID_PREFIX} from './wikitree_api';
|
||||||
@@ -255,9 +249,11 @@ function getMarriedName(person: Person) {
|
|||||||
* @param person The WikiTree Person to resolve names for.
|
* @param person The WikiTree Person to resolve names for.
|
||||||
* @returns Object containing birth, married, and aka names.
|
* @returns Object containing birth, married, and aka names.
|
||||||
*/
|
*/
|
||||||
export function convertPersonNames(
|
export function convertPersonNames(person: Person): {
|
||||||
person: Person,
|
birth?: string;
|
||||||
): {birth?: string; married?: string; aka?: string} {
|
married?: string;
|
||||||
|
aka?: string;
|
||||||
|
} {
|
||||||
const birth =
|
const birth =
|
||||||
person.LastNameAtBirth !== 'Unknown' ? person.LastNameAtBirth : undefined;
|
person.LastNameAtBirth !== 'Unknown' ? person.LastNameAtBirth : undefined;
|
||||||
const married = getMarriedName(person);
|
const married = getMarriedName(person);
|
||||||
@@ -270,10 +266,7 @@ export function convertPersonNames(
|
|||||||
return {birth, married, aka};
|
return {birth, married, aka};
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseDate(
|
function parseDate(date: string, dataStatus?: string): DateOrRange | undefined {
|
||||||
date: string,
|
|
||||||
dataStatus?: string,
|
|
||||||
): DateOrRange | undefined {
|
|
||||||
if (!date) {
|
if (!date) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user