mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 05:05:42 +01:00
Remove deepcopy dependency
This commit is contained in:
parent
b217fba235
commit
cbf5663179
22 changed files with 22 additions and 37 deletions
|
@ -114,7 +114,6 @@
|
|||
"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
17
src/@types/deepcopy.d.ts
vendored
|
@ -1,17 +0,0 @@
|
|||
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;
|
||||
}
|
3
src/misc/deepcopy.ts
Normal file
3
src/misc/deepcopy.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export function deepcopy(x: any) {
|
||||
return JSON.parse(JSON.stringify(x));
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packUser } from './user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import AccessToken from './access-token';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packApp } from './app';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import { pack as packUser, IUser } from './user';
|
||||
|
||||
const Blocking = db.get<IBlocking>('blocking');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import { pack as packFolder } from './drive-folder';
|
||||
import { pack as packUser } from './user';
|
||||
import monkDb, { nativeDbConn } from '../db/mongodb';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import DriveFile from './drive-file';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packNote } from './note';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { pack as packUser } from './user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../../../misc/deepcopy';
|
||||
import db from '../../../db/mongodb';
|
||||
import isObjectId from '../../../misc/is-objectid';
|
||||
import { IUser, pack as packUser } from '../../user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../../../misc/deepcopy';
|
||||
import db from '../../../db/mongodb';
|
||||
import isObjectId from '../../../misc/is-objectid';
|
||||
import { IUser, pack as packUser } from '../../user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import { pack as packUser } from './user';
|
||||
import { pack as packFile } from './drive-file';
|
||||
import db from '../db/mongodb';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import { pack as packUser, IUser } from './user';
|
||||
|
||||
const Mute = db.get<IMute>('mute');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import Reaction from './note-reaction';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import rap from '@prezzemolo/rap';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import { IUser, pack as packUser } from './user';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
|
||||
const Signin = db.get<ISignin>('signin');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../misc/deepcopy';
|
||||
import rap from '@prezzemolo/rap';
|
||||
import db from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
|
|
|
@ -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 * as deepcopy from 'deepcopy';
|
||||
import { deepcopy } from '../../misc/deepcopy';
|
||||
|
||||
import { erase, concat } from '../../prelude/array';
|
||||
import insertNoteUnread from './unread';
|
||||
|
|
Loading…
Reference in a new issue