adjust prettier config

This commit is contained in:
Xymorot 2019-06-30 02:00:26 +02:00
parent 35b778bd0b
commit c0fbc4fce4
7 changed files with 55 additions and 165 deletions

View File

@ -3,7 +3,7 @@ tabWidth: 2
semi: true semi: true
singleQuote: true singleQuote: true
arrowParens: always arrowParens: always
printWidth: 80 printWidth: 120
overrides: overrides:
- files: '*.svelte' - files: '*.svelte'
options: options:

View File

@ -2,10 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'unsafe-inline'; img-src *" />
http-equiv="Content-Security-Policy"
content="default-src 'self'; style-src 'unsafe-inline'; img-src *"
/>
<title>Renai</title> <title>Renai</title>
</head> </head>
<body id="app"></body> <body id="app"></body>

View File

@ -17,8 +17,8 @@
"eslint": "eslint .", "eslint": "eslint .",
"tslint-check": "tslint-config-prettier-check ./tslint.json", "tslint-check": "tslint-config-prettier-check ./tslint.json",
"tslint": "tslint -t stylish -c tslint.json -p tsconfig.json", "tslint": "tslint -t stylish -c tslint.json -p tsconfig.json",
"prettier": "prettier --ignore-path .gitignore -c **/*.{html,json,{c,sc,sa,le}ss,yml,svelte,md}", "prettier": "prettier --ignore-path .gitignore -c **/*.{html,json,{c,sc,sa,le}ss,yml,svelte,md,ts,js}",
"prettier:write": "prettier --ignore-path .gitignore --write **/*.{html,json,{c,sc,sa,le}ss,yml,svelte,md}" "prettier:write": "prettier --ignore-path .gitignore --write **/*.{html,json,{c,sc,sa,le}ss,yml,svelte,md,ts,js}"
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {

View File

@ -1,11 +1,4 @@
import { import { Column, Entity, JoinTable, ManyToMany, ManyToOne, OneToMany } from 'typeorm';
Column,
Entity,
JoinTable,
ManyToMany,
ManyToOne,
OneToMany,
} from 'typeorm';
import { Base } from './bases/base'; import { Base } from './bases/base';
import { Book } from './book'; import { Book } from './book';
import { CopyType } from './copy-type'; import { CopyType } from './copy-type';

View File

@ -42,18 +42,12 @@ export class initialMigration1561296682728 implements MigrationInterface {
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "copy_sources_source" ("copyId" integer NOT NULL, "sourceId" integer NOT NULL, PRIMARY KEY ("copyId", "sourceId"))` `CREATE TABLE "copy_sources_source" ("copyId" integer NOT NULL, "sourceId" integer NOT NULL, PRIMARY KEY ("copyId", "sourceId"))`
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") `);
`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") ` await queryRunner.query(`CREATE INDEX "IDX_946af3644f779b7cc7e7eb04eb" ON "copy_sources_source" ("sourceId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_946af3644f779b7cc7e7eb04eb" ON "copy_sources_source" ("sourceId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "copy_languages_language" ("copyId" integer NOT NULL, "languageId" integer NOT NULL, PRIMARY KEY ("copyId", "languageId"))` `CREATE TABLE "copy_languages_language" ("copyId" integer NOT NULL, "languageId" integer NOT NULL, PRIMARY KEY ("copyId", "languageId"))`
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_056de447bd9e4b2efdf5eafe49" ON "copy_languages_language" ("copyId") `);
`CREATE INDEX "IDX_056de447bd9e4b2efdf5eafe49" ON "copy_languages_language" ("copyId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_c6adacfab107dc725d4fb5864b" ON "copy_languages_language" ("languageId") ` `CREATE INDEX "IDX_c6adacfab107dc725d4fb5864b" ON "copy_languages_language" ("languageId") `
); );
@ -69,39 +63,25 @@ export class initialMigration1561296682728 implements MigrationInterface {
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_authors_author" ("bookId" integer NOT NULL, "authorId" integer NOT NULL, PRIMARY KEY ("bookId", "authorId"))` `CREATE TABLE "book_authors_author" ("bookId" integer NOT NULL, "authorId" integer NOT NULL, PRIMARY KEY ("bookId", "authorId"))`
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_9bf58ffb2a12a8609a738ee8ca" ON "book_authors_author" ("bookId") `);
`CREATE INDEX "IDX_9bf58ffb2a12a8609a738ee8ca" ON "book_authors_author" ("bookId") ` await queryRunner.query(`CREATE INDEX "IDX_a4cafdf2ec9974524a5321c751" ON "book_authors_author" ("authorId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_a4cafdf2ec9974524a5321c751" ON "book_authors_author" ("authorId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_fictions_fiction" ("bookId" integer NOT NULL, "fictionId" integer NOT NULL, PRIMARY KEY ("bookId", "fictionId"))` `CREATE TABLE "book_fictions_fiction" ("bookId" integer NOT NULL, "fictionId" integer NOT NULL, PRIMARY KEY ("bookId", "fictionId"))`
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_893dfbd84bd3a5a62e8a0758b3" ON "book_fictions_fiction" ("bookId") `);
`CREATE INDEX "IDX_893dfbd84bd3a5a62e8a0758b3" ON "book_fictions_fiction" ("bookId") ` await queryRunner.query(`CREATE INDEX "IDX_842bd3a8cb49dc7a92058b7f7a" ON "book_fictions_fiction" ("fictionId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_842bd3a8cb49dc7a92058b7f7a" ON "book_fictions_fiction" ("fictionId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_characters_character" ("bookId" integer NOT NULL, "characterId" integer NOT NULL, PRIMARY KEY ("bookId", "characterId"))` `CREATE TABLE "book_characters_character" ("bookId" integer NOT NULL, "characterId" integer NOT NULL, PRIMARY KEY ("bookId", "characterId"))`
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_261dcea7cb50a485906440f91f" ON "book_characters_character" ("bookId") `);
`CREATE INDEX "IDX_261dcea7cb50a485906440f91f" ON "book_characters_character" ("bookId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_51615a52cc3ef773766afbcc43" ON "book_characters_character" ("characterId") ` `CREATE INDEX "IDX_51615a52cc3ef773766afbcc43" ON "book_characters_character" ("characterId") `
); );
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_tags_tag" ("bookId" integer NOT NULL, "tagId" integer NOT NULL, PRIMARY KEY ("bookId", "tagId"))` `CREATE TABLE "book_tags_tag" ("bookId" integer NOT NULL, "tagId" integer NOT NULL, PRIMARY KEY ("bookId", "tagId"))`
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_918a7b7552fe5fd66f328d4fe8" ON "book_tags_tag" ("bookId") `);
`CREATE INDEX "IDX_918a7b7552fe5fd66f328d4fe8" ON "book_tags_tag" ("bookId") ` await queryRunner.query(`CREATE INDEX "IDX_5274aca0a1468ed55afdfaba24" ON "book_tags_tag" ("tagId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_5274aca0a1468ed55afdfaba24" ON "book_tags_tag" ("tagId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "temporary_copy_type" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar NOT NULL, "comment" varchar, "copyId" integer NOT NULL, CONSTRAINT "FK_156b15213d57b5dbbbc33e94050" FOREIGN KEY ("copyId") REFERENCES "copy" ("id") ON DELETE CASCADE ON UPDATE CASCADE)` `CREATE TABLE "temporary_copy_type" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar NOT NULL, "comment" varchar, "copyId" integer NOT NULL, CONSTRAINT "FK_156b15213d57b5dbbbc33e94050" FOREIGN KEY ("copyId") REFERENCES "copy" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
); );
@ -109,9 +89,7 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_copy_type"("id", "type", "comment", "copyId") SELECT "id", "type", "comment", "copyId" FROM "copy_type"` `INSERT INTO "temporary_copy_type"("id", "type", "comment", "copyId") SELECT "id", "type", "comment", "copyId" FROM "copy_type"`
); );
await queryRunner.query(`DROP TABLE "copy_type"`); await queryRunner.query(`DROP TABLE "copy_type"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_copy_type" RENAME TO "copy_type"`);
`ALTER TABLE "temporary_copy_type" RENAME TO "copy_type"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "temporary_source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer NOT NULL, CONSTRAINT "UQ_028f4c3a05a9bfcddb95a4916b9" UNIQUE ("uri"), CONSTRAINT "FK_73b253e679f350d140bdb104e49" FOREIGN KEY ("siteId") REFERENCES "site" ("id") ON DELETE CASCADE ON UPDATE CASCADE)` `CREATE TABLE "temporary_source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer NOT NULL, CONSTRAINT "UQ_028f4c3a05a9bfcddb95a4916b9" UNIQUE ("uri"), CONSTRAINT "FK_73b253e679f350d140bdb104e49" FOREIGN KEY ("siteId") REFERENCES "site" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
); );
@ -119,9 +97,7 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_source"("id", "uri", "siteId") SELECT "id", "uri", "siteId" FROM "source"` `INSERT INTO "temporary_source"("id", "uri", "siteId") SELECT "id", "uri", "siteId" FROM "source"`
); );
await queryRunner.query(`DROP TABLE "source"`); await queryRunner.query(`DROP TABLE "source"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_source" RENAME TO "source"`);
`ALTER TABLE "temporary_source" RENAME TO "source"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "temporary_copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "favorited" boolean NOT NULL DEFAULT (0), "isDigital" boolean NOT NULL, "originalId" integer NOT NULL, CONSTRAINT "FK_e8ce0011cf0a8b9fdc8ad908a44" FOREIGN KEY ("originalId") REFERENCES "book" ("id") ON DELETE CASCADE ON UPDATE CASCADE)` `CREATE TABLE "temporary_copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "favorited" boolean NOT NULL DEFAULT (0), "isDigital" boolean NOT NULL, "originalId" integer NOT NULL, CONSTRAINT "FK_e8ce0011cf0a8b9fdc8ad908a44" FOREIGN KEY ("originalId") REFERENCES "book" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
); );
@ -139,15 +115,9 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_copy_sources_source"("copyId", "sourceId") SELECT "copyId", "sourceId" FROM "copy_sources_source"` `INSERT INTO "temporary_copy_sources_source"("copyId", "sourceId") SELECT "copyId", "sourceId" FROM "copy_sources_source"`
); );
await queryRunner.query(`DROP TABLE "copy_sources_source"`); await queryRunner.query(`DROP TABLE "copy_sources_source"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_copy_sources_source" RENAME TO "copy_sources_source"`);
`ALTER TABLE "temporary_copy_sources_source" RENAME TO "copy_sources_source"` await queryRunner.query(`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") `);
); await queryRunner.query(`CREATE INDEX "IDX_946af3644f779b7cc7e7eb04eb" ON "copy_sources_source" ("sourceId") `);
await queryRunner.query(
`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") `
);
await queryRunner.query(
`CREATE INDEX "IDX_946af3644f779b7cc7e7eb04eb" ON "copy_sources_source" ("sourceId") `
);
await queryRunner.query(`DROP INDEX "IDX_056de447bd9e4b2efdf5eafe49"`); await queryRunner.query(`DROP INDEX "IDX_056de447bd9e4b2efdf5eafe49"`);
await queryRunner.query(`DROP INDEX "IDX_c6adacfab107dc725d4fb5864b"`); await queryRunner.query(`DROP INDEX "IDX_c6adacfab107dc725d4fb5864b"`);
await queryRunner.query( await queryRunner.query(
@ -157,12 +127,8 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_copy_languages_language"("copyId", "languageId") SELECT "copyId", "languageId" FROM "copy_languages_language"` `INSERT INTO "temporary_copy_languages_language"("copyId", "languageId") SELECT "copyId", "languageId" FROM "copy_languages_language"`
); );
await queryRunner.query(`DROP TABLE "copy_languages_language"`); await queryRunner.query(`DROP TABLE "copy_languages_language"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_copy_languages_language" RENAME TO "copy_languages_language"`);
`ALTER TABLE "temporary_copy_languages_language" RENAME TO "copy_languages_language"` await queryRunner.query(`CREATE INDEX "IDX_056de447bd9e4b2efdf5eafe49" ON "copy_languages_language" ("copyId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_056de447bd9e4b2efdf5eafe49" ON "copy_languages_language" ("copyId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_c6adacfab107dc725d4fb5864b" ON "copy_languages_language" ("languageId") ` `CREATE INDEX "IDX_c6adacfab107dc725d4fb5864b" ON "copy_languages_language" ("languageId") `
); );
@ -193,15 +159,9 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_book_authors_author"("bookId", "authorId") SELECT "bookId", "authorId" FROM "book_authors_author"` `INSERT INTO "temporary_book_authors_author"("bookId", "authorId") SELECT "bookId", "authorId" FROM "book_authors_author"`
); );
await queryRunner.query(`DROP TABLE "book_authors_author"`); await queryRunner.query(`DROP TABLE "book_authors_author"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_book_authors_author" RENAME TO "book_authors_author"`);
`ALTER TABLE "temporary_book_authors_author" RENAME TO "book_authors_author"` await queryRunner.query(`CREATE INDEX "IDX_9bf58ffb2a12a8609a738ee8ca" ON "book_authors_author" ("bookId") `);
); await queryRunner.query(`CREATE INDEX "IDX_a4cafdf2ec9974524a5321c751" ON "book_authors_author" ("authorId") `);
await queryRunner.query(
`CREATE INDEX "IDX_9bf58ffb2a12a8609a738ee8ca" ON "book_authors_author" ("bookId") `
);
await queryRunner.query(
`CREATE INDEX "IDX_a4cafdf2ec9974524a5321c751" ON "book_authors_author" ("authorId") `
);
await queryRunner.query(`DROP INDEX "IDX_893dfbd84bd3a5a62e8a0758b3"`); await queryRunner.query(`DROP INDEX "IDX_893dfbd84bd3a5a62e8a0758b3"`);
await queryRunner.query(`DROP INDEX "IDX_842bd3a8cb49dc7a92058b7f7a"`); await queryRunner.query(`DROP INDEX "IDX_842bd3a8cb49dc7a92058b7f7a"`);
await queryRunner.query( await queryRunner.query(
@ -211,15 +171,9 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_book_fictions_fiction"("bookId", "fictionId") SELECT "bookId", "fictionId" FROM "book_fictions_fiction"` `INSERT INTO "temporary_book_fictions_fiction"("bookId", "fictionId") SELECT "bookId", "fictionId" FROM "book_fictions_fiction"`
); );
await queryRunner.query(`DROP TABLE "book_fictions_fiction"`); await queryRunner.query(`DROP TABLE "book_fictions_fiction"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_book_fictions_fiction" RENAME TO "book_fictions_fiction"`);
`ALTER TABLE "temporary_book_fictions_fiction" RENAME TO "book_fictions_fiction"` await queryRunner.query(`CREATE INDEX "IDX_893dfbd84bd3a5a62e8a0758b3" ON "book_fictions_fiction" ("bookId") `);
); await queryRunner.query(`CREATE INDEX "IDX_842bd3a8cb49dc7a92058b7f7a" ON "book_fictions_fiction" ("fictionId") `);
await queryRunner.query(
`CREATE INDEX "IDX_893dfbd84bd3a5a62e8a0758b3" ON "book_fictions_fiction" ("bookId") `
);
await queryRunner.query(
`CREATE INDEX "IDX_842bd3a8cb49dc7a92058b7f7a" ON "book_fictions_fiction" ("fictionId") `
);
await queryRunner.query(`DROP INDEX "IDX_261dcea7cb50a485906440f91f"`); await queryRunner.query(`DROP INDEX "IDX_261dcea7cb50a485906440f91f"`);
await queryRunner.query(`DROP INDEX "IDX_51615a52cc3ef773766afbcc43"`); await queryRunner.query(`DROP INDEX "IDX_51615a52cc3ef773766afbcc43"`);
await queryRunner.query( await queryRunner.query(
@ -229,12 +183,8 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_book_characters_character"("bookId", "characterId") SELECT "bookId", "characterId" FROM "book_characters_character"` `INSERT INTO "temporary_book_characters_character"("bookId", "characterId") SELECT "bookId", "characterId" FROM "book_characters_character"`
); );
await queryRunner.query(`DROP TABLE "book_characters_character"`); await queryRunner.query(`DROP TABLE "book_characters_character"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_book_characters_character" RENAME TO "book_characters_character"`);
`ALTER TABLE "temporary_book_characters_character" RENAME TO "book_characters_character"` await queryRunner.query(`CREATE INDEX "IDX_261dcea7cb50a485906440f91f" ON "book_characters_character" ("bookId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_261dcea7cb50a485906440f91f" ON "book_characters_character" ("bookId") `
);
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_51615a52cc3ef773766afbcc43" ON "book_characters_character" ("characterId") ` `CREATE INDEX "IDX_51615a52cc3ef773766afbcc43" ON "book_characters_character" ("characterId") `
); );
@ -247,23 +197,15 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "temporary_book_tags_tag"("bookId", "tagId") SELECT "bookId", "tagId" FROM "book_tags_tag"` `INSERT INTO "temporary_book_tags_tag"("bookId", "tagId") SELECT "bookId", "tagId" FROM "book_tags_tag"`
); );
await queryRunner.query(`DROP TABLE "book_tags_tag"`); await queryRunner.query(`DROP TABLE "book_tags_tag"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "temporary_book_tags_tag" RENAME TO "book_tags_tag"`);
`ALTER TABLE "temporary_book_tags_tag" RENAME TO "book_tags_tag"` await queryRunner.query(`CREATE INDEX "IDX_918a7b7552fe5fd66f328d4fe8" ON "book_tags_tag" ("bookId") `);
); await queryRunner.query(`CREATE INDEX "IDX_5274aca0a1468ed55afdfaba24" ON "book_tags_tag" ("tagId") `);
await queryRunner.query(
`CREATE INDEX "IDX_918a7b7552fe5fd66f328d4fe8" ON "book_tags_tag" ("bookId") `
);
await queryRunner.query(
`CREATE INDEX "IDX_5274aca0a1468ed55afdfaba24" ON "book_tags_tag" ("tagId") `
);
} }
public async down(queryRunner: QueryRunner): Promise<any> { public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`DROP INDEX "IDX_5274aca0a1468ed55afdfaba24"`); await queryRunner.query(`DROP INDEX "IDX_5274aca0a1468ed55afdfaba24"`);
await queryRunner.query(`DROP INDEX "IDX_918a7b7552fe5fd66f328d4fe8"`); await queryRunner.query(`DROP INDEX "IDX_918a7b7552fe5fd66f328d4fe8"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "book_tags_tag" RENAME TO "temporary_book_tags_tag"`);
`ALTER TABLE "book_tags_tag" RENAME TO "temporary_book_tags_tag"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_tags_tag" ("bookId" integer NOT NULL, "tagId" integer NOT NULL, PRIMARY KEY ("bookId", "tagId"))` `CREATE TABLE "book_tags_tag" ("bookId" integer NOT NULL, "tagId" integer NOT NULL, PRIMARY KEY ("bookId", "tagId"))`
); );
@ -271,17 +213,11 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "book_tags_tag"("bookId", "tagId") SELECT "bookId", "tagId" FROM "temporary_book_tags_tag"` `INSERT INTO "book_tags_tag"("bookId", "tagId") SELECT "bookId", "tagId" FROM "temporary_book_tags_tag"`
); );
await queryRunner.query(`DROP TABLE "temporary_book_tags_tag"`); await queryRunner.query(`DROP TABLE "temporary_book_tags_tag"`);
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_5274aca0a1468ed55afdfaba24" ON "book_tags_tag" ("tagId") `);
`CREATE INDEX "IDX_5274aca0a1468ed55afdfaba24" ON "book_tags_tag" ("tagId") ` await queryRunner.query(`CREATE INDEX "IDX_918a7b7552fe5fd66f328d4fe8" ON "book_tags_tag" ("bookId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_918a7b7552fe5fd66f328d4fe8" ON "book_tags_tag" ("bookId") `
);
await queryRunner.query(`DROP INDEX "IDX_51615a52cc3ef773766afbcc43"`); await queryRunner.query(`DROP INDEX "IDX_51615a52cc3ef773766afbcc43"`);
await queryRunner.query(`DROP INDEX "IDX_261dcea7cb50a485906440f91f"`); await queryRunner.query(`DROP INDEX "IDX_261dcea7cb50a485906440f91f"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "book_characters_character" RENAME TO "temporary_book_characters_character"`);
`ALTER TABLE "book_characters_character" RENAME TO "temporary_book_characters_character"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_characters_character" ("bookId" integer NOT NULL, "characterId" integer NOT NULL, PRIMARY KEY ("bookId", "characterId"))` `CREATE TABLE "book_characters_character" ("bookId" integer NOT NULL, "characterId" integer NOT NULL, PRIMARY KEY ("bookId", "characterId"))`
); );
@ -292,14 +228,10 @@ export class initialMigration1561296682728 implements MigrationInterface {
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_51615a52cc3ef773766afbcc43" ON "book_characters_character" ("characterId") ` `CREATE INDEX "IDX_51615a52cc3ef773766afbcc43" ON "book_characters_character" ("characterId") `
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_261dcea7cb50a485906440f91f" ON "book_characters_character" ("bookId") `);
`CREATE INDEX "IDX_261dcea7cb50a485906440f91f" ON "book_characters_character" ("bookId") `
);
await queryRunner.query(`DROP INDEX "IDX_842bd3a8cb49dc7a92058b7f7a"`); await queryRunner.query(`DROP INDEX "IDX_842bd3a8cb49dc7a92058b7f7a"`);
await queryRunner.query(`DROP INDEX "IDX_893dfbd84bd3a5a62e8a0758b3"`); await queryRunner.query(`DROP INDEX "IDX_893dfbd84bd3a5a62e8a0758b3"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "book_fictions_fiction" RENAME TO "temporary_book_fictions_fiction"`);
`ALTER TABLE "book_fictions_fiction" RENAME TO "temporary_book_fictions_fiction"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_fictions_fiction" ("bookId" integer NOT NULL, "fictionId" integer NOT NULL, PRIMARY KEY ("bookId", "fictionId"))` `CREATE TABLE "book_fictions_fiction" ("bookId" integer NOT NULL, "fictionId" integer NOT NULL, PRIMARY KEY ("bookId", "fictionId"))`
); );
@ -307,17 +239,11 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "book_fictions_fiction"("bookId", "fictionId") SELECT "bookId", "fictionId" FROM "temporary_book_fictions_fiction"` `INSERT INTO "book_fictions_fiction"("bookId", "fictionId") SELECT "bookId", "fictionId" FROM "temporary_book_fictions_fiction"`
); );
await queryRunner.query(`DROP TABLE "temporary_book_fictions_fiction"`); await queryRunner.query(`DROP TABLE "temporary_book_fictions_fiction"`);
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_842bd3a8cb49dc7a92058b7f7a" ON "book_fictions_fiction" ("fictionId") `);
`CREATE INDEX "IDX_842bd3a8cb49dc7a92058b7f7a" ON "book_fictions_fiction" ("fictionId") ` await queryRunner.query(`CREATE INDEX "IDX_893dfbd84bd3a5a62e8a0758b3" ON "book_fictions_fiction" ("bookId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_893dfbd84bd3a5a62e8a0758b3" ON "book_fictions_fiction" ("bookId") `
);
await queryRunner.query(`DROP INDEX "IDX_a4cafdf2ec9974524a5321c751"`); await queryRunner.query(`DROP INDEX "IDX_a4cafdf2ec9974524a5321c751"`);
await queryRunner.query(`DROP INDEX "IDX_9bf58ffb2a12a8609a738ee8ca"`); await queryRunner.query(`DROP INDEX "IDX_9bf58ffb2a12a8609a738ee8ca"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "book_authors_author" RENAME TO "temporary_book_authors_author"`);
`ALTER TABLE "book_authors_author" RENAME TO "temporary_book_authors_author"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "book_authors_author" ("bookId" integer NOT NULL, "authorId" integer NOT NULL, PRIMARY KEY ("bookId", "authorId"))` `CREATE TABLE "book_authors_author" ("bookId" integer NOT NULL, "authorId" integer NOT NULL, PRIMARY KEY ("bookId", "authorId"))`
); );
@ -325,12 +251,8 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "book_authors_author"("bookId", "authorId") SELECT "bookId", "authorId" FROM "temporary_book_authors_author"` `INSERT INTO "book_authors_author"("bookId", "authorId") SELECT "bookId", "authorId" FROM "temporary_book_authors_author"`
); );
await queryRunner.query(`DROP TABLE "temporary_book_authors_author"`); await queryRunner.query(`DROP TABLE "temporary_book_authors_author"`);
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_a4cafdf2ec9974524a5321c751" ON "book_authors_author" ("authorId") `);
`CREATE INDEX "IDX_a4cafdf2ec9974524a5321c751" ON "book_authors_author" ("authorId") ` await queryRunner.query(`CREATE INDEX "IDX_9bf58ffb2a12a8609a738ee8ca" ON "book_authors_author" ("bookId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_9bf58ffb2a12a8609a738ee8ca" ON "book_authors_author" ("bookId") `
);
await queryRunner.query(`DROP INDEX "IDX_e19e5193f168ce07f52f15be06"`); await queryRunner.query(`DROP INDEX "IDX_e19e5193f168ce07f52f15be06"`);
await queryRunner.query(`DROP INDEX "IDX_2a20d8eaf28ebc28438271899f"`); await queryRunner.query(`DROP INDEX "IDX_2a20d8eaf28ebc28438271899f"`);
await queryRunner.query( await queryRunner.query(
@ -342,9 +264,7 @@ export class initialMigration1561296682728 implements MigrationInterface {
await queryRunner.query( await queryRunner.query(
`INSERT INTO "copy_translators_translator"("copyId", "translatorId") SELECT "copyId", "translatorId" FROM "temporary_copy_translators_translator"` `INSERT INTO "copy_translators_translator"("copyId", "translatorId") SELECT "copyId", "translatorId" FROM "temporary_copy_translators_translator"`
); );
await queryRunner.query( await queryRunner.query(`DROP TABLE "temporary_copy_translators_translator"`);
`DROP TABLE "temporary_copy_translators_translator"`
);
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_e19e5193f168ce07f52f15be06" ON "copy_translators_translator" ("translatorId") ` `CREATE INDEX "IDX_e19e5193f168ce07f52f15be06" ON "copy_translators_translator" ("translatorId") `
); );
@ -353,9 +273,7 @@ export class initialMigration1561296682728 implements MigrationInterface {
); );
await queryRunner.query(`DROP INDEX "IDX_c6adacfab107dc725d4fb5864b"`); await queryRunner.query(`DROP INDEX "IDX_c6adacfab107dc725d4fb5864b"`);
await queryRunner.query(`DROP INDEX "IDX_056de447bd9e4b2efdf5eafe49"`); await queryRunner.query(`DROP INDEX "IDX_056de447bd9e4b2efdf5eafe49"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "copy_languages_language" RENAME TO "temporary_copy_languages_language"`);
`ALTER TABLE "copy_languages_language" RENAME TO "temporary_copy_languages_language"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "copy_languages_language" ("copyId" integer NOT NULL, "languageId" integer NOT NULL, PRIMARY KEY ("copyId", "languageId"))` `CREATE TABLE "copy_languages_language" ("copyId" integer NOT NULL, "languageId" integer NOT NULL, PRIMARY KEY ("copyId", "languageId"))`
); );
@ -366,14 +284,10 @@ export class initialMigration1561296682728 implements MigrationInterface {
await queryRunner.query( await queryRunner.query(
`CREATE INDEX "IDX_c6adacfab107dc725d4fb5864b" ON "copy_languages_language" ("languageId") ` `CREATE INDEX "IDX_c6adacfab107dc725d4fb5864b" ON "copy_languages_language" ("languageId") `
); );
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_056de447bd9e4b2efdf5eafe49" ON "copy_languages_language" ("copyId") `);
`CREATE INDEX "IDX_056de447bd9e4b2efdf5eafe49" ON "copy_languages_language" ("copyId") `
);
await queryRunner.query(`DROP INDEX "IDX_946af3644f779b7cc7e7eb04eb"`); await queryRunner.query(`DROP INDEX "IDX_946af3644f779b7cc7e7eb04eb"`);
await queryRunner.query(`DROP INDEX "IDX_653c33c5db26b8736e592ff3f6"`); await queryRunner.query(`DROP INDEX "IDX_653c33c5db26b8736e592ff3f6"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "copy_sources_source" RENAME TO "temporary_copy_sources_source"`);
`ALTER TABLE "copy_sources_source" RENAME TO "temporary_copy_sources_source"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "copy_sources_source" ("copyId" integer NOT NULL, "sourceId" integer NOT NULL, PRIMARY KEY ("copyId", "sourceId"))` `CREATE TABLE "copy_sources_source" ("copyId" integer NOT NULL, "sourceId" integer NOT NULL, PRIMARY KEY ("copyId", "sourceId"))`
); );
@ -381,12 +295,8 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "copy_sources_source"("copyId", "sourceId") SELECT "copyId", "sourceId" FROM "temporary_copy_sources_source"` `INSERT INTO "copy_sources_source"("copyId", "sourceId") SELECT "copyId", "sourceId" FROM "temporary_copy_sources_source"`
); );
await queryRunner.query(`DROP TABLE "temporary_copy_sources_source"`); await queryRunner.query(`DROP TABLE "temporary_copy_sources_source"`);
await queryRunner.query( await queryRunner.query(`CREATE INDEX "IDX_946af3644f779b7cc7e7eb04eb" ON "copy_sources_source" ("sourceId") `);
`CREATE INDEX "IDX_946af3644f779b7cc7e7eb04eb" ON "copy_sources_source" ("sourceId") ` await queryRunner.query(`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") `);
);
await queryRunner.query(
`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") `
);
await queryRunner.query(`ALTER TABLE "copy" RENAME TO "temporary_copy"`); await queryRunner.query(`ALTER TABLE "copy" RENAME TO "temporary_copy"`);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "favorited" boolean NOT NULL DEFAULT (0), "isDigital" boolean NOT NULL, "originalId" integer NOT NULL)` `CREATE TABLE "copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "favorited" boolean NOT NULL DEFAULT (0), "isDigital" boolean NOT NULL, "originalId" integer NOT NULL)`
@ -395,9 +305,7 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "copy"("id", "favorited", "isDigital", "originalId") SELECT "id", "favorited", "isDigital", "originalId" FROM "temporary_copy"` `INSERT INTO "copy"("id", "favorited", "isDigital", "originalId") SELECT "id", "favorited", "isDigital", "originalId" FROM "temporary_copy"`
); );
await queryRunner.query(`DROP TABLE "temporary_copy"`); await queryRunner.query(`DROP TABLE "temporary_copy"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "source" RENAME TO "temporary_source"`);
`ALTER TABLE "source" RENAME TO "temporary_source"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer NOT NULL, CONSTRAINT "UQ_028f4c3a05a9bfcddb95a4916b9" UNIQUE ("uri"))` `CREATE TABLE "source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer NOT NULL, CONSTRAINT "UQ_028f4c3a05a9bfcddb95a4916b9" UNIQUE ("uri"))`
); );
@ -405,9 +313,7 @@ export class initialMigration1561296682728 implements MigrationInterface {
`INSERT INTO "source"("id", "uri", "siteId") SELECT "id", "uri", "siteId" FROM "temporary_source"` `INSERT INTO "source"("id", "uri", "siteId") SELECT "id", "uri", "siteId" FROM "temporary_source"`
); );
await queryRunner.query(`DROP TABLE "temporary_source"`); await queryRunner.query(`DROP TABLE "temporary_source"`);
await queryRunner.query( await queryRunner.query(`ALTER TABLE "copy_type" RENAME TO "temporary_copy_type"`);
`ALTER TABLE "copy_type" RENAME TO "temporary_copy_type"`
);
await queryRunner.query( await queryRunner.query(
`CREATE TABLE "copy_type" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar NOT NULL, "comment" varchar, "copyId" integer NOT NULL)` `CREATE TABLE "copy_type" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar NOT NULL, "comment" varchar, "copyId" integer NOT NULL)`
); );

View File

@ -44,9 +44,7 @@
function handleMousemove(event) { function handleMousemove(event) {
if (dragging) { if (dragging) {
const dragPos = const dragPos =
mode === 'h' mode === 'h' ? event.x - divide.getBoundingClientRect().x : event.y - divide.getBoundingClientRect().y;
? event.x - divide.getBoundingClientRect().x
: event.y - divide.getBoundingClientRect().y;
basisFirst = dragPos / total; basisFirst = dragPos / total;
basisSecond = 1 - basisFirst; basisSecond = 1 - basisFirst;
} }
@ -125,11 +123,7 @@
<div class="divide__elem divide__elem--first"> <div class="divide__elem divide__elem--first">
<slot name="1"></slot> <slot name="1"></slot>
</div> </div>
<div <div class="{classesDivider}" draggable="true" on:mousedown|preventDefault="{handleMousedown}"></div>
class="{classesDivider}"
draggable="true"
on:mousedown|preventDefault="{handleMousedown}"
></div>
<div class="divide__elem divide__elem--second"> <div class="divide__elem divide__elem--second">
<slot name="2"></slot> <slot name="2"></slot>
</div> </div>

View File

@ -1,6 +1,6 @@
export function c(input: Array<string | boolean> | object): string { export function c(input: Array<string | boolean> | object): string {
const array = Array.isArray(input) const array = Array.isArray(input)
? input.filter(el => typeof el === 'string') ? input.filter((el: any) => typeof el === 'string')
: Object.keys(input).filter((key: keyof object) => !!input[key]); : Object.keys(input).filter((key: keyof object) => !!input[key]);
return array.join(' '); return array.join(' ');
} }