mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
Merge branch 'master' into contest-access-lock
This commit is contained in:
commit
a6f48233d1
5 files changed
+6
-9
No files matched your search
@@ -1,8 +1,5 @@
|
|||||||
import AdmZip from 'adm-zip';
|
import AdmZip from 'adm-zip';
|
||||||
import fs from 'fs-extra';
|
|
||||||
import yaml from 'js-yaml';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import moment from 'moment-timezone';
|
|
||||||
import Schema from 'schemastery';
|
import Schema from 'schemastery';
|
||||||
import superagent from 'superagent';
|
import superagent from 'superagent';
|
||||||
import { Context } from './context';
|
import { Context } from './context';
|
||||||
@@ -12,7 +9,7 @@ export * from './utils';
|
|||||||
export * from './interface';
|
export * from './interface';
|
||||||
export * from './typeutils';
|
export * from './typeutils';
|
||||||
export {
|
export {
|
||||||
Schema, yaml, fs, AdmZip, superagent, _, moment,
|
Schema, AdmZip, superagent, _,
|
||||||
};
|
};
|
||||||
export const definePlugin = <T = never>(args: {
|
export const definePlugin = <T = never>(args: {
|
||||||
using?: keyof Context[];
|
using?: keyof Context[];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment-timezone';
|
||||||
import { FilterQuery, ObjectID } from 'mongodb';
|
import { FilterQuery, ObjectID } from 'mongodb';
|
||||||
import { Context } from '../context';
|
import { Context } from '../context';
|
||||||
import { DiscussionNodeNotFoundError, DocumentNotFoundError } from '../error';
|
import { DiscussionNodeNotFoundError, DocumentNotFoundError } from '../error';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { extname } from 'path';
|
import { extname } from 'path';
|
||||||
import { escapeRegExp } from 'lodash';
|
import { escapeRegExp } from 'lodash';
|
||||||
import { lookup } from 'mime-types';
|
import { lookup } from 'mime-types';
|
||||||
import moment from 'moment';
|
import moment from 'moment-timezone';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import type { Readable } from 'stream';
|
import type { Readable } from 'stream';
|
||||||
import * as bus from '../service/bus';
|
import * as bus from '../service/bus';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment-timezone';
|
||||||
import { ObjectID } from 'mongodb';
|
import { ObjectID } from 'mongodb';
|
||||||
import { buildContent } from './lib/content';
|
import { buildContent } from './lib/content';
|
||||||
import { Logger } from './logger';
|
import { Logger } from './logger';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import path from 'path';
|
|||||||
import { Duplex } from 'stream';
|
import { Duplex } from 'stream';
|
||||||
import { inspect } from 'util';
|
import { inspect } from 'util';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import { isMoment, Moment } from 'moment-timezone';
|
import moment, { isMoment, Moment } from 'moment-timezone';
|
||||||
import { ObjectID } from 'mongodb';
|
import { ObjectID } from 'mongodb';
|
||||||
import Logger from 'reggol';
|
import Logger from 'reggol';
|
||||||
export * as yaml from 'js-yaml';
|
export * as yaml from 'js-yaml';
|
||||||
@@ -18,7 +18,7 @@ Logger.targets[0].label = {
|
|||||||
margin: 1,
|
margin: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { Logger };
|
export { Logger, moment };
|
||||||
|
|
||||||
const encrypt = (algorithm, content) => crypto.createHash(algorithm).update(content).digest('hex');
|
const encrypt = (algorithm, content) => crypto.createHash(algorithm).update(content).digest('hex');
|
||||||
export const sha1 = (content: string) => encrypt('sha1', content);
|
export const sha1 = (content: string) => encrypt('sha1', content);
|
||||||
|
|||||||
Reference in new issue
Block a user