From cfa7ba12da8ddcc3f7cc2461171a65e24370b2ca Mon Sep 17 00:00:00 2001 From: Xymorot Date: Fri, 10 Apr 2020 05:12:14 +0200 Subject: [PATCH] update: update prettier to major version 2, reformat code accordingly --- .prettierrc.yml | 1 + package-lock.json | 6 +-- package.json | 2 +- src/main.spec.ts | 8 +-- src/main/entities/library/author-name.ts | 14 ++---- src/main/entities/library/author-role-name.ts | 14 ++---- src/main/entities/library/author-role.ts | 10 +--- src/main/entities/library/author.ts | 10 +--- src/main/entities/library/character-tag.ts | 28 ++++------- src/main/entities/library/collection-name.ts | 14 ++---- src/main/entities/library/collection-part.ts | 28 ++++------- src/main/entities/library/collection.ts | 10 +--- src/main/entities/library/copy.ts | 19 +++---- src/main/entities/library/interaction-tag.ts | 24 +++------ src/main/entities/library/language.ts | 5 +- src/main/entities/library/site-name.ts | 14 ++---- src/main/entities/library/site.ts | 10 +--- src/main/entities/library/source.ts | 19 +++---- src/main/entities/library/tag-name.ts | 14 ++---- src/main/entities/library/tag.ts | 30 +++-------- .../library/transformation-type-name.ts | 14 ++---- .../entities/library/transformation-type.ts | 5 +- src/main/entities/library/transformation.ts | 42 ++++++---------- src/main/entities/library/work-author.ts | 33 ++++-------- .../entities/library/work-character-name.ts | 14 ++---- src/main/entities/library/work-character.ts | 39 ++++----------- src/main/entities/library/work-name.ts | 14 ++---- src/main/entities/library/work-tag.ts | 28 ++++------- src/main/entities/library/work.ts | 50 ++++--------------- .../entities/library/world-character-name.ts | 14 ++---- src/main/entities/library/world-character.ts | 25 ++-------- src/main/entities/library/world-name.ts | 14 ++---- src/main/entities/library/world.ts | 25 ++-------- src/main/modules/store/store.spec.ts | 2 +- .../modules/web-crawler/web-crawler.spec.ts | 2 +- src/renderer/services/utils.spec.ts | 8 +-- src/services/uuid.spec.ts | 2 +- 37 files changed, 187 insertions(+), 424 deletions(-) diff --git a/.prettierrc.yml b/.prettierrc.yml index 2c9212b..6b8f98e 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -5,6 +5,7 @@ singleQuote: true quoteProps: consistent arrowParens: always printWidth: 120 +endOfLine: lf overrides: - files: '*.svelte' options: diff --git a/package-lock.json b/package-lock.json index 6772838..a9c2421 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8240,9 +8240,9 @@ "dev": true }, "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.4.tgz", + "integrity": "sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w==", "dev": true }, "pretty-bytes": { diff --git a/package.json b/package.json index 68a5f41..bee1f0c 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "mocha": "^7.1.1", "nock": "^12.0.3", "nyc": "^15.0.1", - "prettier": "^1.19.1", + "prettier": "^2.0.4", "rewiremock": "^3.13.9", "sinon": "^9.0.2", "spectron": "^10.0.1", diff --git a/src/main.spec.ts b/src/main.spec.ts index 78b0d9e..12740aa 100644 --- a/src/main.spec.ts +++ b/src/main.spec.ts @@ -8,10 +8,10 @@ import packageJson from '../package.json'; rewiremock.disable(); -describe('Application @slow', function() { +describe('Application @slow', function () { this.timeout(20000); - before(function() { + before(function () { this.app = new Application({ // @ts-ignore this does give the path to electron executable (hopefully platform agnostic) path: electron.default, @@ -20,13 +20,13 @@ describe('Application @slow', function() { return this.app.start(); }); - after(function() { + after(function () { if (this.app && this.app.isRunning()) { return this.app.stop(); } }); - it('shows an initial window', function() { + it('shows an initial window', function () { return this.app.client.getWindowCount().then((count: number) => { expect(count).to.be.gte(1); }); diff --git a/src/main/entities/library/author-name.ts b/src/main/entities/library/author-name.ts index 293b263..a3f6a8b 100644 --- a/src/main/entities/library/author-name.ts +++ b/src/main/entities/library/author-name.ts @@ -6,15 +6,11 @@ export class AuthorName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => Author, - (author: Author) => author.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Author, (author: Author) => author.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/author-role-name.ts b/src/main/entities/library/author-role-name.ts index 5c443ae..80f727f 100644 --- a/src/main/entities/library/author-role-name.ts +++ b/src/main/entities/library/author-role-name.ts @@ -6,15 +6,11 @@ export class AuthorRoleName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => AuthorRole, - (authorRole: AuthorRole) => authorRole.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => AuthorRole, (authorRole: AuthorRole) => authorRole.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/author-role.ts b/src/main/entities/library/author-role.ts index e4ff93f..d7b1948 100644 --- a/src/main/entities/library/author-role.ts +++ b/src/main/entities/library/author-role.ts @@ -16,19 +16,13 @@ export class AuthorRole implements IIdentifiableEntity, IMultiNamedEntity, IDesc }) public nameCanonical: string; - @OneToMany( - () => AuthorRoleName, - (authorRoleName: AuthorRoleName) => authorRoleName.entity - ) + @OneToMany(() => AuthorRoleName, (authorRoleName: AuthorRoleName) => authorRoleName.entity) public names: Promise; /** * relation to the entity connecting with the author and work */ - @ManyToMany( - () => WorkAuthor, - (workAuthor: WorkAuthor) => workAuthor.authorRoles - ) + @ManyToMany(() => WorkAuthor, (workAuthor: WorkAuthor) => workAuthor.authorRoles) public workAuthors: Promise; @Column() diff --git a/src/main/entities/library/author.ts b/src/main/entities/library/author.ts index a75637b..2afc4f0 100644 --- a/src/main/entities/library/author.ts +++ b/src/main/entities/library/author.ts @@ -15,18 +15,12 @@ export class Author implements IIdentifiableEntity, IMultiNamedEntity { }) public nameCanonical: string; - @OneToMany( - () => AuthorName, - (authorName: AuthorName) => authorName.entity - ) + @OneToMany(() => AuthorName, (authorName: AuthorName) => authorName.entity) public names: Promise; /** * ultimately connects the author with a work and their role in that work */ - @OneToMany( - () => WorkAuthor, - (workAuthor: WorkAuthor) => workAuthor.author - ) + @OneToMany(() => WorkAuthor, (workAuthor: WorkAuthor) => workAuthor.author) public workAuthors: Promise; } diff --git a/src/main/entities/library/character-tag.ts b/src/main/entities/library/character-tag.ts index 65fbeab..efdb6d8 100644 --- a/src/main/entities/library/character-tag.ts +++ b/src/main/entities/library/character-tag.ts @@ -15,29 +15,21 @@ export class CharacterTag implements IIdentifiableEntity, IWeightedEntity { /** * the character ina work this tag describes */ - @ManyToOne( - () => WorkCharacter, - (workCharacter: WorkCharacter) => workCharacter.characterTags, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.characterTags, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public workCharacter: Promise; /** * the describing tag */ - @ManyToOne( - () => Tag, - (tag: Tag) => tag.characterTags, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Tag, (tag: Tag) => tag.characterTags, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public tag: Promise; @Column() diff --git a/src/main/entities/library/collection-name.ts b/src/main/entities/library/collection-name.ts index 5c39686..227d6b2 100644 --- a/src/main/entities/library/collection-name.ts +++ b/src/main/entities/library/collection-name.ts @@ -6,15 +6,11 @@ export class CollectionName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => Collection, - (collection: Collection) => collection.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Collection, (collection: Collection) => collection.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/collection-part.ts b/src/main/entities/library/collection-part.ts index bff0191..78c0323 100644 --- a/src/main/entities/library/collection-part.ts +++ b/src/main/entities/library/collection-part.ts @@ -14,29 +14,21 @@ export class CollectionPart implements IIdentifiableEntity, IOrderableEntity { /** * the collection thw work is a part of */ - @ManyToOne( - () => Collection, - (collection: Collection) => collection.parts, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Collection, (collection: Collection) => collection.parts, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public collection: Promise; /** * the work inside the collection */ - @ManyToOne( - () => Work, - (work: Work) => work.collectionParts, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.collectionParts, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public work: Promise; @Column({ diff --git a/src/main/entities/library/collection.ts b/src/main/entities/library/collection.ts index 351cce4..c1196c6 100644 --- a/src/main/entities/library/collection.ts +++ b/src/main/entities/library/collection.ts @@ -18,18 +18,12 @@ export class Collection implements IIdentifiableEntity, IMultiNamedEntity { @Column() public nameCanonical: string; - @OneToMany( - () => CollectionName, - (collectionName: CollectionName) => collectionName.entity - ) + @OneToMany(() => CollectionName, (collectionName: CollectionName) => collectionName.entity) public names: Promise; /** * the connecting entity between this collection and the work */ - @OneToMany( - () => CollectionPart, - (collectionPart: CollectionPart) => collectionPart.collection - ) + @OneToMany(() => CollectionPart, (collectionPart: CollectionPart) => collectionPart.collection) public parts: Promise; } diff --git a/src/main/entities/library/copy.ts b/src/main/entities/library/copy.ts index 9f4060f..9a9b1a7 100644 --- a/src/main/entities/library/copy.ts +++ b/src/main/entities/library/copy.ts @@ -16,24 +16,17 @@ export class Copy implements IIdentifiableEntity { /** * the work this entity is a copy of */ - @ManyToOne( - () => Work, - (work: Work) => work.copies, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.copies, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public original: Promise; /** * where to find this specific copy */ - @ManyToMany( - () => Source, - (source: Source) => source.copies - ) + @ManyToMany(() => Source, (source: Source) => source.copies) public sources: Promise; /** diff --git a/src/main/entities/library/interaction-tag.ts b/src/main/entities/library/interaction-tag.ts index b27d97e..89c0587 100644 --- a/src/main/entities/library/interaction-tag.ts +++ b/src/main/entities/library/interaction-tag.ts @@ -15,33 +15,23 @@ export class InteractionTag implements IIdentifiableEntity, IWeightedEntity { /** * the describing tag */ - @ManyToOne( - () => Tag, - (tag: Tag) => tag.interactionTags, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Tag, (tag: Tag) => tag.interactionTags, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public tag: Promise; /** * the actors of this interaction */ - @ManyToMany( - () => WorkCharacter, - (workCharacter: WorkCharacter) => workCharacter.interactWith - ) + @ManyToMany(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.interactWith) public subjectCharacters: Promise; /** * the receivers of this interaction */ - @ManyToMany( - () => WorkCharacter, - (workCharacter: WorkCharacter) => workCharacter.interactedBy - ) + @ManyToMany(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.interactedBy) public objectCharacters: Promise; @Column() diff --git a/src/main/entities/library/language.ts b/src/main/entities/library/language.ts index a2b2fdc..ec526f7 100644 --- a/src/main/entities/library/language.ts +++ b/src/main/entities/library/language.ts @@ -15,9 +15,6 @@ export class Language { /** * the works using this language */ - @ManyToMany( - () => Work, - (work: Work) => work.languages - ) + @ManyToMany(() => Work, (work: Work) => work.languages) public works: Promise; } diff --git a/src/main/entities/library/site-name.ts b/src/main/entities/library/site-name.ts index 2f4c329..af64866 100644 --- a/src/main/entities/library/site-name.ts +++ b/src/main/entities/library/site-name.ts @@ -6,15 +6,11 @@ export class SiteName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => Site, - (site: Site) => site.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Site, (site: Site) => site.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/site.ts b/src/main/entities/library/site.ts index e9efc87..f32d538 100644 --- a/src/main/entities/library/site.ts +++ b/src/main/entities/library/site.ts @@ -15,18 +15,12 @@ export class Site implements IIdentifiableEntity, IMultiNamedEntity { }) public nameCanonical: string; - @OneToMany( - () => SiteName, - (siteName: SiteName) => siteName.entity - ) + @OneToMany(() => SiteName, (siteName: SiteName) => siteName.entity) public names: Promise; /** * sources belonging to this site */ - @OneToMany( - () => Source, - (source: Source) => source.site - ) + @OneToMany(() => Source, (source: Source) => source.site) public sources: Promise; } diff --git a/src/main/entities/library/source.ts b/src/main/entities/library/source.ts index 2505649..85e344f 100644 --- a/src/main/entities/library/source.ts +++ b/src/main/entities/library/source.ts @@ -21,23 +21,16 @@ export class Source implements IIdentifiableEntity { /** * the site connected to the source */ - @ManyToOne( - () => Site, - (site: Site) => site.sources, - { - nullable: true, - onDelete: 'RESTRICT', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Site, (site: Site) => site.sources, { + nullable: true, + onDelete: 'RESTRICT', + onUpdate: 'CASCADE', + }) public site: Promise; /** * the copies which can be found here */ - @ManyToMany( - () => Copy, - (copy: Copy) => copy.sources - ) + @ManyToMany(() => Copy, (copy: Copy) => copy.sources) public copies: Promise; } diff --git a/src/main/entities/library/tag-name.ts b/src/main/entities/library/tag-name.ts index fe2f1e1..a7a26ac 100644 --- a/src/main/entities/library/tag-name.ts +++ b/src/main/entities/library/tag-name.ts @@ -6,15 +6,11 @@ export class TagName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => Tag, - (tag: Tag) => tag.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Tag, (tag: Tag) => tag.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/tag.ts b/src/main/entities/library/tag.ts index bf5d51f..1d944a7 100644 --- a/src/main/entities/library/tag.ts +++ b/src/main/entities/library/tag.ts @@ -20,49 +20,31 @@ export class Tag implements IIdentifiableEntity, IMultiNamedEntity, IDescribable }) public nameCanonical: string; - @OneToMany( - () => TagName, - (tagName: TagName) => tagName.entity - ) + @OneToMany(() => TagName, (tagName: TagName) => tagName.entity) public names: Promise; /** * this tag tagging a work */ - @OneToMany( - () => WorkTag, - (workTag: WorkTag) => workTag.tag - ) + @OneToMany(() => WorkTag, (workTag: WorkTag) => workTag.tag) public workTags: Promise; /** * this tag tagging characters */ - @OneToMany( - () => CharacterTag, - (characterTag: CharacterTag) => characterTag.tag - ) + @OneToMany(() => CharacterTag, (characterTag: CharacterTag) => characterTag.tag) public characterTags: Promise; /** * this tag tagging a character interaction */ - @OneToMany( - () => InteractionTag, - (interactionTag: InteractionTag) => interactionTag.tag - ) + @OneToMany(() => InteractionTag, (interactionTag: InteractionTag) => interactionTag.tag) public interactionTags: Promise; - @ManyToMany( - () => Tag, - (tag: Tag) => tag.children - ) + @ManyToMany(() => Tag, (tag: Tag) => tag.children) public parents: Promise; - @ManyToMany( - () => Tag, - (tag: Tag) => tag.parents - ) + @ManyToMany(() => Tag, (tag: Tag) => tag.parents) public children: Promise; @Column({ diff --git a/src/main/entities/library/transformation-type-name.ts b/src/main/entities/library/transformation-type-name.ts index 182becb..970453a 100644 --- a/src/main/entities/library/transformation-type-name.ts +++ b/src/main/entities/library/transformation-type-name.ts @@ -6,15 +6,11 @@ export class TransformationTypeName implements IIdentifiableEntity, INameEntity @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => TransformationType, - (transformationType: TransformationType) => transformationType.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => TransformationType, (transformationType: TransformationType) => transformationType.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/transformation-type.ts b/src/main/entities/library/transformation-type.ts index 613896d..9727333 100644 --- a/src/main/entities/library/transformation-type.ts +++ b/src/main/entities/library/transformation-type.ts @@ -30,10 +30,7 @@ export class TransformationType implements IIdentifiableEntity, IMultiNamedEntit /** * the transformations of this type */ - @OneToMany( - () => Transformation, - (transformation: Transformation) => transformation.type - ) + @OneToMany(() => Transformation, (transformation: Transformation) => transformation.type) public transformations: Promise; /** diff --git a/src/main/entities/library/transformation.ts b/src/main/entities/library/transformation.ts index 5f3f079..84cddac 100644 --- a/src/main/entities/library/transformation.ts +++ b/src/main/entities/library/transformation.ts @@ -13,43 +13,31 @@ export class Transformation implements IIdentifiableEntity, IOrderableEntity { /** * the work based on the original */ - @ManyToOne( - () => Work, - (work: Work) => work.transformationOf, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.transformationOf, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public byWork: Promise; /** * the transformation type */ - @ManyToOne( - () => TransformationType, - (transformationType: TransformationType) => transformationType.transformations, - { - nullable: false, - onDelete: 'RESTRICT', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => TransformationType, (transformationType: TransformationType) => transformationType.transformations, { + nullable: false, + onDelete: 'RESTRICT', + onUpdate: 'CASCADE', + }) public type: Promise; /** * the original work */ - @ManyToOne( - () => Work, - (work: Work) => work.transformedBy, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.transformedBy, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public ofWork: Promise; @Column({ diff --git a/src/main/entities/library/work-author.ts b/src/main/entities/library/work-author.ts index b690082..aabf8f1 100644 --- a/src/main/entities/library/work-author.ts +++ b/src/main/entities/library/work-author.ts @@ -14,38 +14,27 @@ export class WorkAuthor implements IIdentifiableEntity, IOrderableEntity { /** * the work */ - @ManyToOne( - () => Work, - (work: Work) => work.workAuthors, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.workAuthors, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public work: Promise; /** * the roles of the author in the work */ - @ManyToMany( - () => AuthorRole, - (authorRole: AuthorRole) => authorRole.workAuthors - ) + @ManyToMany(() => AuthorRole, (authorRole: AuthorRole) => authorRole.workAuthors) public authorRoles: Promise; /** * the author */ - @ManyToOne( - () => Author, - (author: Author) => author.workAuthors, - { - nullable: false, - onDelete: 'RESTRICT', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Author, (author: Author) => author.workAuthors, { + nullable: false, + onDelete: 'RESTRICT', + onUpdate: 'CASCADE', + }) public author: Promise; @Column({ diff --git a/src/main/entities/library/work-character-name.ts b/src/main/entities/library/work-character-name.ts index ea925c7..7652121 100644 --- a/src/main/entities/library/work-character-name.ts +++ b/src/main/entities/library/work-character-name.ts @@ -6,15 +6,11 @@ export class WorkCharacterName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => WorkCharacter, - (workCharacter: WorkCharacter) => workCharacter.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/work-character.ts b/src/main/entities/library/work-character.ts index 0d1ec0b..e5c6ea2 100644 --- a/src/main/entities/library/work-character.ts +++ b/src/main/entities/library/work-character.ts @@ -19,59 +19,40 @@ export class WorkCharacter implements IIdentifiableEntity, IMultiNamedEntity { }) public nameCanonical: string; - @OneToMany( - () => WorkCharacterName, - (workCharacterName: WorkCharacterName) => workCharacterName.entity - ) + @OneToMany(() => WorkCharacterName, (workCharacterName: WorkCharacterName) => workCharacterName.entity) public names: Promise; /** * the work the character is a part of */ - @ManyToOne( - () => Work, - (work: Work) => work.workCharacters, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.workCharacters, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public work: Promise; /** * interaction with other characters as actor */ - @ManyToMany( - () => InteractionTag, - (interactionTag: InteractionTag) => interactionTag.subjectCharacters - ) + @ManyToMany(() => InteractionTag, (interactionTag: InteractionTag) => interactionTag.subjectCharacters) public interactWith: Promise; /** * interaction with other characters as receiver */ - @ManyToMany( - () => InteractionTag, - (interactionTag: InteractionTag) => interactionTag.objectCharacters - ) + @ManyToMany(() => InteractionTag, (interactionTag: InteractionTag) => interactionTag.objectCharacters) public interactedBy: Promise; /** * tags connected to the character */ - @OneToMany( - () => CharacterTag, - (characterTag: CharacterTag) => characterTag.workCharacter - ) + @OneToMany(() => CharacterTag, (characterTag: CharacterTag) => characterTag.workCharacter) public characterTags: Promise; /** * existing characters characer is based on */ - @ManyToMany( - () => WorldCharacter, - (worldCharacter: WorldCharacter) => worldCharacter.workCharacters - ) + @ManyToMany(() => WorldCharacter, (worldCharacter: WorldCharacter) => worldCharacter.workCharacters) public worldCharacters: Promise; } diff --git a/src/main/entities/library/work-name.ts b/src/main/entities/library/work-name.ts index f355e1b..8f54d90 100644 --- a/src/main/entities/library/work-name.ts +++ b/src/main/entities/library/work-name.ts @@ -6,15 +6,11 @@ export class WorkName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => Work, - (work: Work) => work.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/work-tag.ts b/src/main/entities/library/work-tag.ts index 4b8c403..0ee12a8 100644 --- a/src/main/entities/library/work-tag.ts +++ b/src/main/entities/library/work-tag.ts @@ -15,29 +15,21 @@ export class WorkTag implements IIdentifiableEntity, IWeightedEntity { /** * the describing tag */ - @ManyToOne( - () => Tag, - (tag: Tag) => tag.workTags, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Tag, (tag: Tag) => tag.workTags, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public tag: Promise; /** * the tagged work */ - @ManyToOne( - () => Work, - (work: Work) => work.workTags, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => Work, (work: Work) => work.workTags, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public work: Promise; @Column() diff --git a/src/main/entities/library/work.ts b/src/main/entities/library/work.ts index afde9fb..ca9d4a2 100644 --- a/src/main/entities/library/work.ts +++ b/src/main/entities/library/work.ts @@ -26,73 +26,49 @@ export class Work implements IIdentifiableEntity, IMultiNamedEntity { }) public nameCanonical: string; - @OneToMany( - () => WorkName, - (workName: WorkName) => workName.entity - ) + @OneToMany(() => WorkName, (workName: WorkName) => workName.entity) public names: Promise; /** * digital representations of this work */ - @OneToMany( - () => Copy, - (copy: Copy) => copy.original - ) + @OneToMany(() => Copy, (copy: Copy) => copy.original) public copies: Promise; /** * other works this work is a transformation of */ - @OneToMany( - () => Transformation, - (transformation: Transformation) => transformation.byWork - ) + @OneToMany(() => Transformation, (transformation: Transformation) => transformation.byWork) public transformationOf: Promise; /** * other works this work is transformed by */ - @OneToMany( - () => Transformation, - (transformation: Transformation) => transformation.ofWork - ) + @OneToMany(() => Transformation, (transformation: Transformation) => transformation.ofWork) public transformedBy: Promise; /** * the authors/publishers of this work */ - @OneToMany( - () => WorkAuthor, - (workAuthor: WorkAuthor) => workAuthor.work - ) + @OneToMany(() => WorkAuthor, (workAuthor: WorkAuthor) => workAuthor.work) public workAuthors: Promise; /** * tags describing this work */ - @OneToMany( - () => WorkTag, - (workTag: WorkTag) => workTag.work - ) + @OneToMany(() => WorkTag, (workTag: WorkTag) => workTag.work) public workTags: Promise; /** * characters in this work */ - @OneToMany( - () => WorkCharacter, - (workCharacter: WorkCharacter) => workCharacter.work - ) + @OneToMany(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.work) public workCharacters: Promise; /** * fictional worlds in which this work takes place */ - @ManyToMany( - () => World, - (world: World) => world.works - ) + @ManyToMany(() => World, (world: World) => world.works) public worlds: Promise; /** @@ -123,18 +99,12 @@ export class Work implements IIdentifiableEntity, IMultiNamedEntity { /** * the languages of the work (if applicable) */ - @ManyToMany( - () => Language, - (language: Language) => language.works - ) + @ManyToMany(() => Language, (language: Language) => language.works) public languages: Promise; /** * the collections this work is a part of */ - @OneToMany( - () => CollectionPart, - (collectionPart: CollectionPart) => collectionPart.work - ) + @OneToMany(() => CollectionPart, (collectionPart: CollectionPart) => collectionPart.work) public collectionParts: Promise; } diff --git a/src/main/entities/library/world-character-name.ts b/src/main/entities/library/world-character-name.ts index 8ac2227..6bf6755 100644 --- a/src/main/entities/library/world-character-name.ts +++ b/src/main/entities/library/world-character-name.ts @@ -6,15 +6,11 @@ export class WorldCharacterName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => WorldCharacter, - (worldCharacter: WorldCharacter) => worldCharacter.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => WorldCharacter, (worldCharacter: WorldCharacter) => worldCharacter.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/world-character.ts b/src/main/entities/library/world-character.ts index d8d87d4..a9d71d4 100644 --- a/src/main/entities/library/world-character.ts +++ b/src/main/entities/library/world-character.ts @@ -16,39 +16,24 @@ export class WorldCharacter implements IIdentifiableEntity, IMultiNamedEntity, I }) public nameCanonical: string; - @OneToMany( - () => WorldCharacterName, - (worldCharacterName: WorldCharacterName) => worldCharacterName.entity - ) + @OneToMany(() => WorldCharacterName, (worldCharacterName: WorldCharacterName) => worldCharacterName.entity) public names: Promise; /** * the characters in works which are based on this one */ - @ManyToMany( - () => WorkCharacter, - (workCharacter: WorkCharacter) => workCharacter.worldCharacters - ) + @ManyToMany(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.worldCharacters) public workCharacters: Promise; /** * the fictional worlds this character is a part of */ - @ManyToMany( - () => World, - (world: World) => world.worldCharacters - ) + @ManyToMany(() => World, (world: World) => world.worldCharacters) public worlds: Promise; - @ManyToMany( - () => WorldCharacter, - (worldCharacter: WorldCharacter) => worldCharacter.children - ) + @ManyToMany(() => WorldCharacter, (worldCharacter: WorldCharacter) => worldCharacter.children) public parents: Promise; - @ManyToMany( - () => WorldCharacter, - (worldCharacter: WorldCharacter) => worldCharacter.parents - ) + @ManyToMany(() => WorldCharacter, (worldCharacter: WorldCharacter) => worldCharacter.parents) public children: Promise; } diff --git a/src/main/entities/library/world-name.ts b/src/main/entities/library/world-name.ts index 0204044..bf37d79 100644 --- a/src/main/entities/library/world-name.ts +++ b/src/main/entities/library/world-name.ts @@ -6,15 +6,11 @@ export class WorldName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; - @ManyToOne( - () => World, - (world: World) => world.names, - { - nullable: false, - onDelete: 'CASCADE', - onUpdate: 'CASCADE', - } - ) + @ManyToOne(() => World, (world: World) => world.names, { + nullable: false, + onDelete: 'CASCADE', + onUpdate: 'CASCADE', + }) public entity: Promise; @Column({ diff --git a/src/main/entities/library/world.ts b/src/main/entities/library/world.ts index 2dc9c91..1acbcb7 100644 --- a/src/main/entities/library/world.ts +++ b/src/main/entities/library/world.ts @@ -16,39 +16,24 @@ export class World implements IIdentifiableEntity, IMultiNamedEntity, IHierachic }) public nameCanonical: string; - @OneToMany( - () => WorldName, - (worldName: WorldName) => worldName.entity - ) + @OneToMany(() => WorldName, (worldName: WorldName) => worldName.entity) public names: Promise; /** * works taking place in this world */ - @ManyToMany( - () => Work, - (work: Work) => work.worlds - ) + @ManyToMany(() => Work, (work: Work) => work.worlds) public works: Promise; /** * canon characters in this world */ - @ManyToMany( - () => WorldCharacter, - (worldCharacter: WorldCharacter) => worldCharacter.worlds - ) + @ManyToMany(() => WorldCharacter, (worldCharacter: WorldCharacter) => worldCharacter.worlds) public worldCharacters: Promise; - @ManyToMany( - () => World, - (world: World) => world.parents - ) + @ManyToMany(() => World, (world: World) => world.parents) public children: Promise; - @ManyToMany( - () => World, - (world: World) => world.children - ) + @ManyToMany(() => World, (world: World) => world.children) public parents: Promise; } diff --git a/src/main/modules/store/store.spec.ts b/src/main/modules/store/store.spec.ts index 8b62730..6ee968e 100644 --- a/src/main/modules/store/store.spec.ts +++ b/src/main/modules/store/store.spec.ts @@ -10,7 +10,7 @@ import { load, save, StoreKeys } from './store'; const storeDirectory = path.resolve(appPath, 'store'); -describe('Store Service', function() { +describe('Store Service', function () { this.timeout(10000); before(() => { diff --git a/src/main/modules/web-crawler/web-crawler.spec.ts b/src/main/modules/web-crawler/web-crawler.spec.ts index a3ddad4..73f3291 100644 --- a/src/main/modules/web-crawler/web-crawler.spec.ts +++ b/src/main/modules/web-crawler/web-crawler.spec.ts @@ -10,7 +10,7 @@ import sinon from 'sinon'; import { WebCrawler } from './web-crawler'; import { storeMock } from '../store/store.mock'; -describe('Web Crawler', function() { +describe('Web Crawler', function () { this.timeout(2000); before(() => { diff --git a/src/renderer/services/utils.spec.ts b/src/renderer/services/utils.spec.ts index 7c45b4b..0930c92 100644 --- a/src/renderer/services/utils.spec.ts +++ b/src/renderer/services/utils.spec.ts @@ -3,7 +3,7 @@ import fc from 'fast-check'; import 'mocha'; import { c, s, t } from './utils'; -describe('Frontend Utils', function() { +describe('Frontend Utils', function () { this.timeout(1000); it("does 'translate' text", () => { @@ -11,7 +11,7 @@ describe('Frontend Utils', function() { }); describe('Class Util', () => { - beforeEach(function() { + beforeEach(function () { const numeric = fc.integer(0x30, 0x39); const alphaCapital = fc.integer(0x41, 0x5a); const alphaSmall = fc.integer(0x61, 0x7a); @@ -29,7 +29,7 @@ describe('Frontend Utils', function() { .filter((thing) => typeof thing !== 'string'); }); - it('compiles classes out of an array', function() { + it('compiles classes out of an array', function () { const classArrayArbitrary = fc.array(fc.oneof(this.className, this.anything)); fc.assert( @@ -45,7 +45,7 @@ describe('Frontend Utils', function() { ); }); - it('compiles classes out of an object', function() { + it('compiles classes out of an object', function () { const classObjectArbitrary = fc.object({ maxDepth: 0, key: this.className, diff --git a/src/services/uuid.spec.ts b/src/services/uuid.spec.ts index ea7ee4d..1b235c0 100644 --- a/src/services/uuid.spec.ts +++ b/src/services/uuid.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import 'mocha'; import { uuid } from './uuid'; -describe('UUID Service', function() { +describe('UUID Service', function () { this.timeout(1000); it('provides universal unique identifiers', () => {