From 1331f0b953d7db15a7a12edc00ec20d8bf789d53 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 18 Jun 2019 15:27:13 +0900 Subject: [PATCH] Use WHATWG API > New application code should use the WHATWG API. --- src/config/load.ts | 1 - src/mfm/fromHtml.ts | 1 - src/misc/convert-host.ts | 1 - src/queue/processors/inbox.ts | 1 - src/remote/activitypub/models/person.ts | 1 - src/remote/activitypub/request.ts | 1 - src/remote/resolve-user.ts | 1 - src/remote/webfinger.ts | 1 - 8 files changed, 8 deletions(-) diff --git a/src/config/load.ts b/src/config/load.ts index 26b25eab4..aeed54d74 100644 --- a/src/config/load.ts +++ b/src/config/load.ts @@ -3,7 +3,6 @@ */ import * as fs from 'fs'; -import { URL } from 'url'; import * as yaml from 'js-yaml'; import { Source, Mixin } from './types'; import * as pkg from '../../package.json'; diff --git a/src/mfm/fromHtml.ts b/src/mfm/fromHtml.ts index 5fc4a1641..60293b07f 100644 --- a/src/mfm/fromHtml.ts +++ b/src/mfm/fromHtml.ts @@ -1,5 +1,4 @@ import { parseFragment, DefaultTreeDocumentFragment } from 'parse5'; -import { URL } from 'url'; import { urlRegex } from './prelude'; export function fromHtml(html: string): string { diff --git a/src/misc/convert-host.ts b/src/misc/convert-host.ts index a5fb15c66..ad52e1258 100644 --- a/src/misc/convert-host.ts +++ b/src/misc/convert-host.ts @@ -1,6 +1,5 @@ import config from '../config'; import { toASCII } from 'punycode'; -import { URL } from 'url'; export function getFullApAccount(username: string, host: string | null) { return host ? `${username}@${toPuny(host)}` : `${username}@${toPuny(config.host)}`; diff --git a/src/queue/processors/inbox.ts b/src/queue/processors/inbox.ts index 21a51c962..e71181ee7 100644 --- a/src/queue/processors/inbox.ts +++ b/src/queue/processors/inbox.ts @@ -3,7 +3,6 @@ import * as httpSignature from 'http-signature'; import { IRemoteUser } from '../../models/entities/user'; import perform from '../../remote/activitypub/perform'; import { resolvePerson, updatePerson } from '../../remote/activitypub/models/person'; -import { URL } from 'url'; import { publishApLogStream } from '../../services/stream'; import Logger from '../../services/logger'; import { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-instance-doc'; diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index dcd64e0cd..bfcad100f 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -6,7 +6,6 @@ import { resolveImage } from './image'; import { isCollectionOrOrderedCollection, isCollection, IPerson } from '../type'; import { DriveFile } from '../../../models/entities/drive-file'; import { fromHtml } from '../../../mfm/fromHtml'; -import { URL } from 'url'; import { resolveNote, extractEmojis } from './note'; import { registerOrFetchInstanceDoc } from '../../../services/register-or-fetch-instance-doc'; import { ITag, extractHashtags } from './tag'; diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index bde4921c3..6d18e5328 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -1,6 +1,5 @@ import { request } from 'https'; import { sign } from 'http-signature'; -import { URL } from 'url'; import * as crypto from 'crypto'; import { lookup, IRunOptions } from 'lookup-dns-cache'; import * as promiseAny from 'promise-any'; diff --git a/src/remote/resolve-user.ts b/src/remote/resolve-user.ts index 0e2b88f05..5253d684d 100644 --- a/src/remote/resolve-user.ts +++ b/src/remote/resolve-user.ts @@ -1,7 +1,6 @@ import webFinger from './webfinger'; import config from '../config'; import { createPerson, updatePerson } from './activitypub/models/person'; -import { URL } from 'url'; import { remoteLogger } from './logger'; import chalk from 'chalk'; import { User, IRemoteUser } from '../models/entities/user'; diff --git a/src/remote/webfinger.ts b/src/remote/webfinger.ts index 800673943..101a31aab 100644 --- a/src/remote/webfinger.ts +++ b/src/remote/webfinger.ts @@ -1,6 +1,5 @@ import config from '../config'; import * as request from 'request-promise-native'; -import { URL } from 'url'; import { query as urlQuery } from '../prelude/url'; type ILink = {