diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:52:23 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:54:01 +0200 |
commit | 2ec349aa857b0bd8f26de5cd78981d60c9b98a69 (patch) | |
tree | c48e4957d0abb778ee5eaa2474c24a9c88f69260 /server/lib | |
parent | 396f6f0140b0f76162e2378fd5a61e2f888673ed (diff) | |
download | PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.tar.gz PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.tar.zst PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.zip |
Prefer using our pick function
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/playlists/shared/url-to-object.ts | 2 | ||||
-rw-r--r-- | server/lib/emailer.ts | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/server/lib/activitypub/playlists/shared/url-to-object.ts b/server/lib/activitypub/playlists/shared/url-to-object.ts index f895db587..41bee3752 100644 --- a/server/lib/activitypub/playlists/shared/url-to-object.ts +++ b/server/lib/activitypub/playlists/shared/url-to-object.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { isArray } from 'lodash' | ||
2 | import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' | 1 | import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' |
2 | import { isArray } from '@server/helpers/custom-validators/misc' | ||
3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
4 | import { doJSONRequest } from '@server/helpers/requests' | 4 | import { doJSONRequest } from '@server/helpers/requests' |
5 | import { PlaylistElementObject, PlaylistObject } from '@shared/models' | 5 | import { PlaylistElementObject, PlaylistObject } from '@shared/models' |
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 9e546de7f..3cdba5c76 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -1,7 +1,8 @@ | |||
1 | import { readFileSync } from 'fs-extra' | 1 | import { readFileSync } from 'fs-extra' |
2 | import { isArray, merge } from 'lodash' | 2 | import { merge } from 'lodash' |
3 | import { createTransport, Transporter } from 'nodemailer' | 3 | import { createTransport, Transporter } from 'nodemailer' |
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import { toArray } from '@server/helpers/custom-validators/misc' | ||
5 | import { root } from '@shared/core-utils' | 6 | import { root } from '@shared/core-utils' |
6 | import { EmailPayload } from '@shared/models' | 7 | import { EmailPayload } from '@shared/models' |
7 | import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model' | 8 | import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model' |
@@ -158,9 +159,7 @@ class Emailer { | |||
158 | subjectPrefix: CONFIG.EMAIL.SUBJECT.PREFIX | 159 | subjectPrefix: CONFIG.EMAIL.SUBJECT.PREFIX |
159 | }) | 160 | }) |
160 | 161 | ||
161 | const toEmails = isArray(options.to) | 162 | const toEmails = toArray(options.to) |
162 | ? options.to | ||
163 | : [ options.to ] | ||
164 | 163 | ||
165 | for (const to of toEmails) { | 164 | for (const to of toEmails) { |
166 | const baseOptions: SendEmailDefaultOptions = { | 165 | const baseOptions: SendEmailDefaultOptions = { |