diff options
Diffstat (limited to 'server')
26 files changed, 28 insertions, 29 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index b2f23c1b0..6fad82408 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -12,7 +12,7 @@ import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '.. | |||
12 | import { remove, writeJSON } from 'fs-extra' | 12 | import { remove, writeJSON } from 'fs-extra' |
13 | import { getServerCommit } from '../../helpers/utils' | 13 | import { getServerCommit } from '../../helpers/utils' |
14 | import { Emailer } from '../../lib/emailer' | 14 | import { Emailer } from '../../lib/emailer' |
15 | import { isNumeric } from 'validator' | 15 | import validator from 'validator' |
16 | import { objectConverter } from '../../helpers/core-utils' | 16 | import { objectConverter } from '../../helpers/core-utils' |
17 | import { CONFIG, reloadConfig } from '../../initializers/config' | 17 | import { CONFIG, reloadConfig } from '../../initializers/config' |
18 | import { PluginManager } from '../../lib/plugins/plugin-manager' | 18 | import { PluginManager } from '../../lib/plugins/plugin-manager' |
@@ -393,7 +393,7 @@ function convertCustomConfigBody (body: CustomConfig) { | |||
393 | } | 393 | } |
394 | 394 | ||
395 | function valueConverter (v: any) { | 395 | function valueConverter (v: any) { |
396 | if (isNumeric(v + '')) return parseInt('' + v, 10) | 396 | if (validator.isNumeric(v + '')) return parseInt('' + v, 10) |
397 | 397 | ||
398 | return v | 398 | return v |
399 | } | 399 | } |
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index 97c809a0c..735f2d73a 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import * as Bluebird from 'bluebird' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { ResultList } from '../../shared/models' | 3 | import { ResultList } from '../../shared/models' |
4 | import { Activity } from '../../shared/models/activitypub' | 4 | import { Activity } from '../../shared/models/activitypub' |
5 | import { ACTIVITY_PUB } from '../initializers/constants' | 5 | import { ACTIVITY_PUB } from '../initializers/constants' |
6 | import { ActorModel } from '../models/activitypub/actor' | ||
7 | import { signJsonLDObject } from './peertube-crypto' | 6 | import { signJsonLDObject } from './peertube-crypto' |
8 | import { pageToStartAndCount } from './core-utils' | 7 | import { pageToStartAndCount } from './core-utils' |
9 | import { parse } from 'url' | 8 | import { parse } from 'url' |
diff --git a/server/helpers/custom-validators/activitypub/activity.ts b/server/helpers/custom-validators/activitypub/activity.ts index f68c76cdc..8b8c0685f 100644 --- a/server/helpers/custom-validators/activitypub/activity.ts +++ b/server/helpers/custom-validators/activitypub/activity.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { Activity, ActivityType } from '../../../../shared/models/activitypub' | 2 | import { Activity, ActivityType } from '../../../../shared/models/activitypub' |
3 | import { sanitizeAndCheckActorObject } from './actor' | 3 | import { sanitizeAndCheckActorObject } from './actor' |
4 | import { isActivityPubUrlValid, isBaseActivityValid, isObjectValid } from './misc' | 4 | import { isActivityPubUrlValid, isBaseActivityValid, isObjectValid } from './misc' |
diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts index ec4dd6f96..fa58e163f 100644 --- a/server/helpers/custom-validators/activitypub/actor.ts +++ b/server/helpers/custom-validators/activitypub/actor.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' | 2 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
3 | import { exists, isArray } from '../misc' | 3 | import { exists, isArray } from '../misc' |
4 | import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' | 4 | import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' |
diff --git a/server/helpers/custom-validators/activitypub/misc.ts b/server/helpers/custom-validators/activitypub/misc.ts index 5afcfbedc..4ee8e6fee 100644 --- a/server/helpers/custom-validators/activitypub/misc.ts +++ b/server/helpers/custom-validators/activitypub/misc.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' | 2 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
3 | import { isTestInstance } from '../../core-utils' | 3 | import { isTestInstance } from '../../core-utils' |
4 | import { exists } from '../misc' | 4 | import { exists } from '../misc' |
diff --git a/server/helpers/custom-validators/activitypub/playlist.ts b/server/helpers/custom-validators/activitypub/playlist.ts index 6c7bdb193..bd0d16a4a 100644 --- a/server/helpers/custom-validators/activitypub/playlist.ts +++ b/server/helpers/custom-validators/activitypub/playlist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { exists, isDateValid } from '../misc' | 1 | import { exists, isDateValid } from '../misc' |
2 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' | 2 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' |
3 | import * as validator from 'validator' | 3 | import validator from 'validator' |
4 | import { PlaylistElementObject } from '../../../../shared/models/activitypub/objects/playlist-element-object' | 4 | import { PlaylistElementObject } from '../../../../shared/models/activitypub/objects/playlist-element-object' |
5 | import { isActivityPubUrlValid } from './misc' | 5 | import { isActivityPubUrlValid } from './misc' |
6 | 6 | ||
diff --git a/server/helpers/custom-validators/activitypub/video-comments.ts b/server/helpers/custom-validators/activitypub/video-comments.ts index ea780ca46..aa3c246b5 100644 --- a/server/helpers/custom-validators/activitypub/video-comments.ts +++ b/server/helpers/custom-validators/activitypub/video-comments.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { ACTIVITY_PUB } from '../../../initializers/constants' | 2 | import { ACTIVITY_PUB } from '../../../initializers/constants' |
3 | import { exists, isArray, isDateValid } from '../misc' | 3 | import { exists, isArray, isDateValid } from '../misc' |
4 | import { isActivityPubUrlValid } from './misc' | 4 | import { isActivityPubUrlValid } from './misc' |
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index a28bebf2d..fe94bd58a 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { ACTIVITY_PUB, CONSTRAINTS_FIELDS } from '../../../initializers/constants' | 2 | import { ACTIVITY_PUB, CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
3 | import { peertubeTruncate } from '../../core-utils' | 3 | import { peertubeTruncate } from '../../core-utils' |
4 | import { exists, isArray, isBooleanValid, isDateValid, isUUIDValid } from '../misc' | 4 | import { exists, isArray, isBooleanValid, isDateValid, isUUIDValid } from '../misc' |
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index 0c3df1cd0..89149b3e0 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { sep } from 'path' | 3 | import { sep } from 'path' |
4 | 4 | ||
5 | function exists (value: any) { | 5 | function exists (value: any) { |
diff --git a/server/helpers/custom-validators/plugins.ts b/server/helpers/custom-validators/plugins.ts index 332418b49..3af72547b 100644 --- a/server/helpers/custom-validators/plugins.ts +++ b/server/helpers/custom-validators/plugins.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { exists, isArray, isSafePath } from './misc' | 1 | import { exists, isArray, isSafePath } from './misc' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { PluginType } from '../../../shared/models/plugins/plugin.type' | 3 | import { PluginType } from '../../../shared/models/plugins/plugin.type' |
4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
5 | import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model' | 5 | import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model' |
diff --git a/server/helpers/custom-validators/search.ts b/server/helpers/custom-validators/search.ts index ee732b15a..bb17134c3 100644 --- a/server/helpers/custom-validators/search.ts +++ b/server/helpers/custom-validators/search.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { isArray } from './misc' | 2 | import { isArray } from './misc' |
3 | 3 | ||
4 | function isNumberArray (value: any) { | 4 | function isNumberArray (value: any) { |
diff --git a/server/helpers/custom-validators/servers.ts b/server/helpers/custom-validators/servers.ts index 7ced36fd3..adf1ea497 100644 --- a/server/helpers/custom-validators/servers.ts +++ b/server/helpers/custom-validators/servers.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { exists, isArray } from './misc' | 2 | import { exists, isArray } from './misc' |
3 | import { isTestInstance } from '../core-utils' | 3 | import { isTestInstance } from '../core-utils' |
4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
diff --git a/server/helpers/custom-validators/user-notifications.ts b/server/helpers/custom-validators/user-notifications.ts index 02ea3bbc2..5a4d10504 100644 --- a/server/helpers/custom-validators/user-notifications.ts +++ b/server/helpers/custom-validators/user-notifications.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { exists } from './misc' | 1 | import { exists } from './misc' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { UserNotificationType } from '../../../shared/models/users' | 3 | import { UserNotificationType } from '../../../shared/models/users' |
4 | import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' | 4 | import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' |
5 | 5 | ||
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts index 008916a04..b4d5751e7 100644 --- a/server/helpers/custom-validators/users.ts +++ b/server/helpers/custom-validators/users.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { UserRole } from '../../../shared' | 2 | import { UserRole } from '../../../shared' |
3 | import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers/constants' |
4 | import { exists, isArray, isBooleanValid, isFileValid } from './misc' | 4 | import { exists, isArray, isBooleanValid, isFileValid } from './misc' |
diff --git a/server/helpers/custom-validators/video-abuses.ts b/server/helpers/custom-validators/video-abuses.ts index e43d12be8..a9478c76a 100644 --- a/server/helpers/custom-validators/video-abuses.ts +++ b/server/helpers/custom-validators/video-abuses.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Response } from 'express' | 1 | import { Response } from 'express' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { CONSTRAINTS_FIELDS, VIDEO_ABUSE_STATES } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS, VIDEO_ABUSE_STATES } from '../../initializers/constants' |
4 | import { exists } from './misc' | 4 | import { exists } from './misc' |
5 | import { VideoAbuseModel } from '../../models/video/video-abuse' | 5 | import { VideoAbuseModel } from '../../models/video/video-abuse' |
diff --git a/server/helpers/custom-validators/video-blacklist.ts b/server/helpers/custom-validators/video-blacklist.ts index 9a44332ef..17cb3b00b 100644 --- a/server/helpers/custom-validators/video-blacklist.ts +++ b/server/helpers/custom-validators/video-blacklist.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { exists } from './misc' | 2 | import { exists } from './misc' |
3 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
4 | import { VideoBlacklistType } from '../../../shared/models/videos' | 4 | import { VideoBlacklistType } from '../../../shared/models/videos' |
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts index 6c52dc093..ded5d5171 100644 --- a/server/helpers/custom-validators/video-channels.ts +++ b/server/helpers/custom-validators/video-channels.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as validator from 'validator' | 1 | import validator from 'validator' |
2 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 2 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
3 | import { exists } from './misc' | 3 | import { exists } from './misc' |
4 | 4 | ||
diff --git a/server/helpers/custom-validators/video-comments.ts b/server/helpers/custom-validators/video-comments.ts index 8a7cd7105..846f28b17 100644 --- a/server/helpers/custom-validators/video-comments.ts +++ b/server/helpers/custom-validators/video-comments.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
4 | 4 | ||
5 | const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS | 5 | const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS |
diff --git a/server/helpers/custom-validators/video-imports.ts b/server/helpers/custom-validators/video-imports.ts index 8820c4c0a..ffad482b4 100644 --- a/server/helpers/custom-validators/video-imports.ts +++ b/server/helpers/custom-validators/video-imports.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { CONSTRAINTS_FIELDS, MIMETYPES, VIDEO_IMPORT_STATES } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS, MIMETYPES, VIDEO_IMPORT_STATES } from '../../initializers/constants' |
4 | import { exists, isFileValid } from './misc' | 4 | import { exists, isFileValid } from './misc' |
5 | import * as express from 'express' | 5 | import * as express from 'express' |
diff --git a/server/helpers/custom-validators/video-playlists.ts b/server/helpers/custom-validators/video-playlists.ts index 60125dcda..4bb8384ab 100644 --- a/server/helpers/custom-validators/video-playlists.ts +++ b/server/helpers/custom-validators/video-playlists.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { exists } from './misc' | 1 | import { exists } from './misc' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { CONSTRAINTS_FIELDS, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES } from '../../initializers/constants' |
4 | import * as express from 'express' | 4 | import * as express from 'express' |
5 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 5 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index ff93f2e99..a9e859e54 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { values } from 'lodash' | 1 | import { values } from 'lodash' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { VideoFilter, VideoPrivacy, VideoRateType } from '../../../shared' | 3 | import { VideoFilter, VideoPrivacy, VideoRateType } from '../../../shared' |
4 | import { | 4 | import { |
5 | CONSTRAINTS_FIELDS, | 5 | CONSTRAINTS_FIELDS, |
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 42a30f84f..2fcf0c4ea 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -4,7 +4,7 @@ import { CUSTOM_HTML_TAG_COMMENTS, EMBED_SIZE, PLUGIN_GLOBAL_CSS_PATH, WEBSERVER | |||
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import { escapeHTML, sha256 } from '../helpers/core-utils' | 5 | import { escapeHTML, sha256 } from '../helpers/core-utils' |
6 | import { VideoModel } from '../models/video/video' | 6 | import { VideoModel } from '../models/video/video' |
7 | import * as validator from 'validator' | 7 | import validator from 'validator' |
8 | import { VideoPrivacy } from '../../shared/models/videos' | 8 | import { VideoPrivacy } from '../../shared/models/videos' |
9 | import { readFile } from 'fs-extra' | 9 | import { readFile } from 'fs-extra' |
10 | import { getActivityStreamDuration } from '../models/video/video-format-utils' | 10 | import { getActivityStreamDuration } from '../models/video/video-format-utils' |
diff --git a/server/models/utils.ts b/server/models/utils.ts index 4199cc443..f89b80011 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Model, Sequelize } from 'sequelize-typescript' | 1 | import { Model, Sequelize } from 'sequelize-typescript' |
2 | import * as validator from 'validator' | 2 | import validator from 'validator' |
3 | import { Col } from 'sequelize/types/lib/utils' | 3 | import { Col } from 'sequelize/types/lib/utils' |
4 | import { literal, OrderItem } from 'sequelize' | 4 | import { literal, OrderItem } from 'sequelize' |
5 | 5 | ||
diff --git a/server/models/video/video-playlist-element.ts b/server/models/video/video-playlist-element.ts index 9d2ea710e..f2d71357f 100644 --- a/server/models/video/video-playlist-element.ts +++ b/server/models/video/video-playlist-element.ts | |||
@@ -19,7 +19,7 @@ import { getSort, throwIfNotValid } from '../utils' | |||
19 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 19 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
20 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 20 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
21 | import { PlaylistElementObject } from '../../../shared/models/activitypub/objects/playlist-element-object' | 21 | import { PlaylistElementObject } from '../../../shared/models/activitypub/objects/playlist-element-object' |
22 | import * as validator from 'validator' | 22 | import validator from 'validator' |
23 | import { AggregateOptions, Op, ScopeOptions, Sequelize, Transaction } from 'sequelize' | 23 | import { AggregateOptions, Op, ScopeOptions, Sequelize, Transaction } from 'sequelize' |
24 | import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../shared/models/videos/playlist/video-playlist-element.model' | 24 | import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../shared/models/videos/playlist/video-playlist-element.model' |
25 | import { AccountModel } from '../account/account' | 25 | import { AccountModel } from '../account/account' |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 1f3c25ecb..fec3dcc20 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -142,7 +142,7 @@ import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../typings/mode | |||
142 | import { MThumbnail } from '../../typings/models/video/thumbnail' | 142 | import { MThumbnail } from '../../typings/models/video/thumbnail' |
143 | import { VideoFile } from '@shared/models/videos/video-file.model' | 143 | import { VideoFile } from '@shared/models/videos/video-file.model' |
144 | import { getHLSDirectory, getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' | 144 | import { getHLSDirectory, getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' |
145 | import * as validator from 'validator' | 145 | import validator from 'validator' |
146 | 146 | ||
147 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation | 147 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation |
148 | const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [ | 148 | const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [ |
diff --git a/server/tests/helpers/core-utils.ts b/server/tests/helpers/core-utils.ts index 2dbe8d635..31fc6dd7c 100644 --- a/server/tests/helpers/core-utils.ts +++ b/server/tests/helpers/core-utils.ts | |||
@@ -4,7 +4,7 @@ import * as chai from 'chai' | |||
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { snakeCase } from 'lodash' | 5 | import { snakeCase } from 'lodash' |
6 | import { objectConverter, parseBytes } from '../../helpers/core-utils' | 6 | import { objectConverter, parseBytes } from '../../helpers/core-utils' |
7 | import { isNumeric } from 'validator' | 7 | import validator from 'validator' |
8 | 8 | ||
9 | const expect = chai.expect | 9 | const expect = chai.expect |
10 | 10 | ||
@@ -53,7 +53,7 @@ describe('Parse Bytes', function () { | |||
53 | } | 53 | } |
54 | 54 | ||
55 | function valueConverter (v: any) { | 55 | function valueConverter (v: any) { |
56 | if (isNumeric(v + '')) return parseInt('' + v, 10) | 56 | if (validator.isNumeric(v + '')) return parseInt('' + v, 10) |
57 | 57 | ||
58 | return v | 58 | return v |
59 | } | 59 | } |