From 5bbf4187e662e33ab8cdd72f8bf7cd1fb7f84b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Wed, 30 Jan 2019 11:51:29 +0900 Subject: [PATCH] Module 'crypto' as import syntax (#4011) --- src/client/app/common/scripts/get-md5.ts | 2 +- src/remote/activitypub/request.ts | 2 +- src/server/api/endpoints/auth/accept.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/app/common/scripts/get-md5.ts b/src/client/app/common/scripts/get-md5.ts index b78a598118..b002d762b1 100644 --- a/src/client/app/common/scripts/get-md5.ts +++ b/src/client/app/common/scripts/get-md5.ts @@ -1,5 +1,5 @@ // スクリプトサイズがデカい -//const crypto = require('crypto'); +//import * as crypto from 'crypto'; export default (data: ArrayBuffer) => { //const buf = new Buffer(data); diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index d98e36b3d7..0ac64fc387 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -2,7 +2,7 @@ import { request } from 'https'; const { sign } = require('http-signature'); import { URL } from 'url'; import * as debug from 'debug'; -const crypto = require('crypto'); +import * as crypto from 'crypto'; const { lookup } = require('lookup-dns-cache'); const promiseAny = require('promise-any'); diff --git a/src/server/api/endpoints/auth/accept.ts b/src/server/api/endpoints/auth/accept.ts index b7e11bd463..3e45a2801f 100644 --- a/src/server/api/endpoints/auth/accept.ts +++ b/src/server/api/endpoints/auth/accept.ts @@ -1,5 +1,5 @@ import rndstr from 'rndstr'; -const crypto = require('crypto'); +import * as crypto from 'crypto'; import $ from 'cafy'; import App from '../../../../models/app'; import AuthSess from '../../../../models/auth-session';