Revert "Remove deepcopy dependency"

This reverts commit cbf5663179.
This commit is contained in:
syuilo 2019-03-19 18:47:14 +09:00
parent cbf5663179
commit da3447765b
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
22 changed files with 37 additions and 22 deletions

View file

@ -114,6 +114,7 @@
"cssnano": "4.1.10",
"dateformat": "3.0.3",
"deep-equal": "1.0.1",
"deepcopy": "0.6.3",
"diskusage": "1.0.0",
"double-ended-queue": "2.1.0-0",
"elasticsearch": "15.4.1",

17
src/@types/deepcopy.d.ts vendored Normal file
View file

@ -0,0 +1,17 @@
declare module 'deepcopy';
declare namespace deepcopy {
type DeepcopyCustomizerValueType = 'Object';
type DeepcopyCustomizer<T> = (
value: T,
valueType: DeepcopyCustomizerValueType) => T;
interface DeepcopyOptions<T> {
customizer: DeepcopyCustomizer<T>;
}
export function deepcopy<T>(
value: T,
options?: DeepcopyOptions<T> | DeepcopyCustomizer<T>): T;
}

View file

@ -1,3 +0,0 @@
export function deepcopy(x: any) {
return JSON.parse(JSON.stringify(x));
}

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { pack as packUser } from './user';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import AccessToken from './access-token';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { pack as packApp } from './app';

View file

@ -1,7 +1,7 @@
import * as mongo from 'mongodb';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import { pack as packUser, IUser } from './user';
const Blocking = db.get<IBlocking>('blocking');

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import { pack as packFolder } from './drive-folder';
import { pack as packUser } from './user';
import monkDb, { nativeDbConn } from '../db/mongodb';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import DriveFile from './drive-file';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { pack as packNote } from './note';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { pack as packUser } from './user';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../../../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../../../db/mongodb';
import isObjectId from '../../../misc/is-objectid';
import { IUser, pack as packUser } from '../../user';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../../../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../../../db/mongodb';
import isObjectId from '../../../misc/is-objectid';
import { IUser, pack as packUser } from '../../user';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import { pack as packUser } from './user';
import { pack as packFile } from './drive-file';
import db from '../db/mongodb';

View file

@ -1,7 +1,7 @@
import * as mongo from 'mongodb';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import { pack as packUser, IUser } from './user';
const Mute = db.get<IMute>('mute');

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import Reaction from './note-reaction';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import rap from '@prezzemolo/rap';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import { IUser, pack as packUser } from './user';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
const Signin = db.get<ISignin>('signin');

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';

View file

@ -1,5 +1,5 @@
import * as mongo from 'mongodb';
import { deepcopy } from '../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import rap from '@prezzemolo/rap';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';

View file

@ -25,7 +25,7 @@ import notesChart from '../../services/chart/notes';
import perUserNotesChart from '../../services/chart/per-user-notes';
import activeUsersChart from '../../services/chart/active-users';
import instanceChart from '../../services/chart/instance';
import { deepcopy } from '../../misc/deepcopy';
import * as deepcopy from 'deepcopy';
import { erase, concat } from '../../prelude/array';
import insertNoteUnread from './unread';