]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Reimplement a typed omit function
authorChocobozzz <me@florianbigard.com>
Wed, 17 Aug 2022 13:25:58 +0000 (15:25 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 17 Aug 2022 13:25:58 +0000 (15:25 +0200)
17 files changed:
server/helpers/logger.ts
server/tests/api/check-params/config.ts
server/tests/api/check-params/live.ts
server/tests/api/check-params/metrics.ts
server/tests/api/check-params/users-admin.ts
server/tests/api/check-params/users.ts
server/tests/api/check-params/video-channels.ts
server/tests/api/check-params/video-imports.ts
server/tests/api/check-params/videos.ts
server/tests/api/moderation/video-blacklist.ts
server/tests/api/transcoding/transcoder.ts
server/tests/client.ts
shared/core-utils/common/object.ts
shared/server-commands/users/users-command.ts
shared/server-commands/videos/live-command.ts
shared/server-commands/videos/playlists-command.ts
shared/server-commands/videos/videos-command.ts

index 9625c1b33b77f44199f87eb9267f577b7f5fa724..6649db40f4a1eef3651976027ff23b39a5874384 100644 (file)
@@ -1,11 +1,11 @@
 import { stat } from 'fs-extra'
-import { omit } from 'lodash'
 import { join } from 'path'
 import { format as sqlFormat } from 'sql-formatter'
 import { createLogger, format, transports } from 'winston'
 import { FileTransportOptions } from 'winston/lib/winston/transports'
 import { context } from '@opentelemetry/api'
 import { getSpanContext } from '@opentelemetry/api/build/src/trace/context-utils'
+import { omit } from '@shared/core-utils'
 import { CONFIG } from '../initializers/config'
 import { LOG_FILENAME } from '../initializers/constants'
 
@@ -204,5 +204,5 @@ function removeCyclicValues () {
 function getAdditionalInfo (info: any) {
   const toOmit = [ 'label', 'timestamp', 'level', 'message', 'sql', 'tags' ]
 
-  return omit(info, ...toOmit)
+  return omit(info, toOmit)
 }
index d67e511239355ba3574ea09f71b3f7d9cce2abac..3415625ca9b1b437f568d052ac4b8efbc9efb539 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-
-import 'mocha'
-import { merge, omit } from 'lodash'
+import { merge } from 'lodash'
+import { omit } from '@shared/core-utils'
 import { CustomConfig, HttpStatusCode } from '@shared/models'
 import {
   cleanupTests,
@@ -277,7 +276,7 @@ describe('Test config API validators', function () {
     })
 
     it('Should fail if it misses a key', async function () {
-      const newUpdateParams = omit(updateParams, 'admin.email')
+      const newUpdateParams = { ...updateParams, admin: omit(updateParams.admin, [ 'email' ]) }
 
       await makePutBodyRequest({
         url: server.url,
index b092f16f9647122575cd236cbfe28d83506ca174..3f553c42bf3f92d436d6662e15947ef90678ed96 100644 (file)
@@ -1,9 +1,7 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { expect } from 'chai'
-import { omit } from 'lodash'
-import { buildAbsoluteFixturePath } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, omit } from '@shared/core-utils'
 import { HttpStatusCode, LiveVideoLatencyMode, VideoCreateResult, VideoPrivacy } from '@shared/models'
 import {
   cleanupTests,
@@ -132,7 +130,7 @@ describe('Test video lives API validator', function () {
     })
 
     it('Should fail without a channel', async function () {
-      const fields = omit(baseCorrectParams, 'channelId')
+      const fields = omit(baseCorrectParams, [ 'channelId' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
index 2d450940686b1dc471bc823d8646fc4efda35a6d..be82532173c9a31ffd227ccbf8719d5994350bf2 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import { omit } from 'lodash'
+import { omit } from '@shared/core-utils'
 import { HttpStatusCode, PlaybackMetricCreate, VideoResolution } from '@shared/models'
 import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
 
@@ -66,7 +65,7 @@ describe('Test metrics API validators', function () {
       await makePostBodyRequest({
         url: server.url,
         path,
-        fields: omit(baseParams, 'playerMode')
+        fields: omit(baseParams, [ 'playerMode' ])
       })
 
       await makePostBodyRequest({
@@ -80,7 +79,7 @@ describe('Test metrics API validators', function () {
       await makePostBodyRequest({
         url: server.url,
         path,
-        fields: omit(baseParams, 'resolutionChanges')
+        fields: omit(baseParams, [ 'resolutionChanges' ])
       })
 
       await makePostBodyRequest({
@@ -98,7 +97,7 @@ describe('Test metrics API validators', function () {
       await makePostBodyRequest({
         url: server.url,
         path,
-        fields: omit(baseParams, 'errors')
+        fields: omit(baseParams, [ 'errors' ])
       })
 
       await makePostBodyRequest({
@@ -112,7 +111,7 @@ describe('Test metrics API validators', function () {
       await makePostBodyRequest({
         url: server.url,
         path,
-        fields: omit(baseParams, 'downloadedBytesP2P')
+        fields: omit(baseParams, [ 'downloadedBytesP2P' ])
       })
 
       await makePostBodyRequest({
@@ -126,7 +125,7 @@ describe('Test metrics API validators', function () {
       await makePostBodyRequest({
         url: server.url,
         path,
-        fields: omit(baseParams, 'downloadedBytesHTTP')
+        fields: omit(baseParams, [ 'downloadedBytesHTTP' ])
       })
 
       await makePostBodyRequest({
@@ -140,7 +139,7 @@ describe('Test metrics API validators', function () {
       await makePostBodyRequest({
         url: server.url,
         path,
-        fields: omit(baseParams, 'uploadedBytesP2P')
+        fields: omit(baseParams, [ 'uploadedBytesP2P' ])
       })
 
       await makePostBodyRequest({
index 716c22556a8560c7e8ecc515e760c8fdd74ed8b6..d941ca0246b521e89a0e42b4e8f4dfb5db88e2c6 100644 (file)
@@ -1,8 +1,7 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import { omit } from 'lodash'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared'
+import { omit } from '@shared/core-utils'
 import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'
 import {
   cleanupTests,
@@ -123,7 +122,7 @@ describe('Test users admin API validators', function () {
     })
 
     it('Should fail with a missing email', async function () {
-      const fields = omit(baseCorrectParams, 'email')
+      const fields = omit(baseCorrectParams, [ 'email' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
@@ -223,13 +222,13 @@ describe('Test users admin API validators', function () {
     })
 
     it('Should fail without a videoQuota', async function () {
-      const fields = omit(baseCorrectParams, 'videoQuota')
+      const fields = omit(baseCorrectParams, [ 'videoQuota' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
 
     it('Should fail without a videoQuotaDaily', async function () {
-      const fields = omit(baseCorrectParams, 'videoQuotaDaily')
+      const fields = omit(baseCorrectParams, [ 'videoQuotaDaily' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
@@ -247,7 +246,7 @@ describe('Test users admin API validators', function () {
     })
 
     it('Should fail without a user role', async function () {
-      const fields = omit(baseCorrectParams, 'role')
+      const fields = omit(baseCorrectParams, [ 'role' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
index 4c4f54958483e6f99537f7562e92767995acb9cf..7acfd8c2cfffd6987cd22a8183b0ed2369311c13 100644 (file)
@@ -1,8 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-
-import 'mocha'
-import { omit } from 'lodash'
 import { MockSmtpServer } from '@server/tests/shared'
+import { omit } from '@shared/core-utils'
 import { HttpStatusCode, UserRole } from '@shared/models'
 import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
 
@@ -57,7 +55,7 @@ describe('Test users API validators', function () {
     })
 
     it('Should fail with a missing email', async function () {
-      const fields = omit(baseCorrectParams, 'email')
+      const fields = omit(baseCorrectParams, [ 'email' ])
 
       await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields })
     })
index 9024126c034760363c2d4147cd773a7847f42807..1782474fd79e698e5c9102e2a8f0e5d71720a2d1 100644 (file)
@@ -1,10 +1,8 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
-import { omit } from 'lodash'
+import { expect } from 'chai'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
-import { buildAbsoluteFixturePath } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, omit } from '@shared/core-utils'
 import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
 import {
   ChannelsCommand,
@@ -18,8 +16,6 @@ import {
   setAccessTokensToServers
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Test video channels API validator', function () {
   const videoChannelPath = '/api/v1/video-channels'
   let server: PeerTubeServer
@@ -121,7 +117,7 @@ describe('Test video channels API validator', function () {
     })
 
     it('Should fail without a name', async function () {
-      const fields = omit(baseCorrectParams, 'name')
+      const fields = omit(baseCorrectParams, [ 'name' ])
       await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields })
     })
 
@@ -131,7 +127,7 @@ describe('Test video channels API validator', function () {
     })
 
     it('Should fail without a name', async function () {
-      const fields = omit(baseCorrectParams, 'displayName')
+      const fields = omit(baseCorrectParams, [ 'displayName' ])
       await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields })
     })
 
index 85382b261e5a04061936e65435a05b0d15cc46da..7f19b9ee9b1f84ae0d6e3c76298ba78d719150e1 100644 (file)
@@ -1,9 +1,7 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import { omit } from 'lodash'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, FIXTURE_URLS } from '@server/tests/shared'
-import { buildAbsoluteFixturePath } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, omit } from '@shared/core-utils'
 import { HttpStatusCode, VideoPrivacy } from '@shared/models'
 import {
   cleanupTests,
@@ -107,7 +105,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail without a target url', async function () {
-      const fields = omit(baseCorrectParams, 'targetUrl')
+      const fields = omit(baseCorrectParams, [ 'targetUrl' ])
       await makePostBodyRequest({
         url: server.url,
         path,
@@ -189,7 +187,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail without a channel', async function () {
-      const fields = omit(baseCorrectParams, 'channelId')
+      const fields = omit(baseCorrectParams, [ 'channelId' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
@@ -271,7 +269,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail with an invalid torrent file', async function () {
-      const fields = omit(baseCorrectParams, 'targetUrl')
+      const fields = omit(baseCorrectParams, [ 'targetUrl' ])
       const attaches = {
         torrentfile: buildAbsoluteFixturePath('avatar-big.png')
       }
@@ -280,7 +278,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail with an invalid magnet URI', async function () {
-      let fields = omit(baseCorrectParams, 'targetUrl')
+      let fields = omit(baseCorrectParams, [ 'targetUrl' ])
       fields = { ...fields, magnetUri: 'blabla' }
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
@@ -339,7 +337,7 @@ describe('Test video imports API validator', function () {
         }
       })
 
-      let fields = omit(baseCorrectParams, 'targetUrl')
+      let fields = omit(baseCorrectParams, [ 'targetUrl' ])
       fields = { ...fields, magnetUri: FIXTURE_URLS.magnet }
 
       await makePostBodyRequest({
@@ -350,7 +348,7 @@ describe('Test video imports API validator', function () {
         expectedStatus: HttpStatusCode.CONFLICT_409
       })
 
-      fields = omit(fields, 'magnetUri')
+      fields = omit(fields, [ 'magnetUri' ])
       const attaches = {
         torrentfile: buildAbsoluteFixturePath('video-720p.torrent')
       }
index e5c9b90c40651aafd2da5dd6ebe85898078dbc1f..572ca8997507791bdfd6dfb60dd3b9f8b942c41f 100644 (file)
@@ -1,11 +1,9 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
-import { omit } from 'lodash'
+import { expect } from 'chai'
 import { join } from 'path'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared'
-import { randomInt, root } from '@shared/core-utils'
+import { omit, randomInt, root } from '@shared/core-utils'
 import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
 import {
   cleanupTests,
@@ -18,8 +16,6 @@ import {
   setAccessTokensToServers
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Test videos API validator', function () {
   const path = '/api/v1/videos/'
   let server: PeerTubeServer
@@ -219,7 +215,7 @@ describe('Test videos API validator', function () {
       })
 
       it('Should fail without name', async function () {
-        const fields = omit(baseCorrectParams, 'name')
+        const fields = omit(baseCorrectParams, [ 'name' ])
         const attaches = baseCorrectAttaches
 
         await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
@@ -268,7 +264,7 @@ describe('Test videos API validator', function () {
       })
 
       it('Should fail without a channel', async function () {
-        const fields = omit(baseCorrectParams, 'channelId')
+        const fields = omit(baseCorrectParams, [ 'channelId' ])
         const attaches = baseCorrectAttaches
 
         await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
index 1790210ffb2ddf4cafd9735c039564cd4674e0c3..a7620b07186dc2706e5618fd901c755e93e046ec 100644 (file)
@@ -2,8 +2,8 @@
 
 import 'mocha'
 import * as chai from 'chai'
-import { orderBy } from 'lodash'
 import { FIXTURE_URLS } from '@server/tests/shared'
+import { sortObjectComparator } from '@shared/core-utils'
 import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
 import {
   BlacklistCommand,
@@ -138,7 +138,7 @@ describe('Test video blacklist', function () {
       expect(blacklistedVideos).to.be.an('array')
       expect(blacklistedVideos.length).to.equal(2)
 
-      const result = orderBy(body.data, [ 'id' ], [ 'desc' ])
+      const result = [ ...body.data ].sort(sortObjectComparator('id', 'desc'))
       expect(blacklistedVideos).to.deep.equal(result)
     })
 
@@ -150,7 +150,7 @@ describe('Test video blacklist', function () {
       expect(blacklistedVideos).to.be.an('array')
       expect(blacklistedVideos.length).to.equal(2)
 
-      const result = orderBy(body.data, [ 'name' ], [ 'desc' ])
+      const result = [ ...body.data ].sort(sortObjectComparator('name', 'desc'))
       expect(blacklistedVideos).to.deep.equal(result)
     })
 
@@ -162,7 +162,7 @@ describe('Test video blacklist', function () {
       expect(blacklistedVideos).to.be.an('array')
       expect(blacklistedVideos.length).to.equal(2)
 
-      const result = orderBy(body.data, [ 'createdAt' ])
+      const result = [ ...body.data ].sort(sortObjectComparator('createdAt', 'asc'))
       expect(blacklistedVideos).to.deep.equal(result)
     })
   })
index 48a20e1d59d5669219f49b4ee20e4aaa273542cd..db012780520ae5414cd775984530b324aabe9cbe 100644 (file)
@@ -1,11 +1,9 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
-import { omit } from 'lodash'
+import { expect } from 'chai'
 import { canDoQuickTranscode } from '@server/helpers/ffmpeg'
 import { generateHighBitrateVideo, generateVideoWithFramerate, getAllFiles } from '@server/tests/shared'
-import { buildAbsoluteFixturePath, getMaxBitrate, getMinLimitBitrate } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, getMaxBitrate, getMinLimitBitrate, omit } from '@shared/core-utils'
 import {
   buildFileMetadata,
   getAudioStream,
@@ -26,8 +24,6 @@ import {
   webtorrentAdd
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 function updateConfigForTranscoding (server: PeerTubeServer) {
   return server.config.updateCustomSubConfig({
     newConfig: {
index a8a697f99bebbf91521d65e6731f8701f314ed84..35b472d767945497786c43d4ba9176d20eacf967 100644 (file)
@@ -2,7 +2,7 @@
 
 import 'mocha'
 import * as chai from 'chai'
-import { omit } from 'lodash'
+import { omit } from '@shared/core-utils'
 import {
   Account,
   HTMLServerConfig,
@@ -31,7 +31,7 @@ function checkIndexTags (html: string, title: string, description: string, css:
   expect(html).to.contain('<meta name="description" content="' + description + '" />')
   expect(html).to.contain('<style class="custom-css-style">' + css + '</style>')
 
-  const htmlConfig: HTMLServerConfig = omit(config, 'signup')
+  const htmlConfig: HTMLServerConfig = omit(config, [ 'signup' ])
   const configObjectString = JSON.stringify(htmlConfig)
   const configEscapedString = JSON.stringify(configObjectString)
 
index 49d209819a9793d190205849877289a311b64e85..2330c94038da1f436878f012bdc2f5e377921809 100644 (file)
@@ -10,6 +10,19 @@ function pick <O extends object, K extends keyof O> (object: O, keys: K[]): Pick
   return result
 }
 
+function omit <O extends object, K extends keyof O> (object: O, keys: K[]): Exclude<O, K> {
+  const result: any = {}
+  const keysSet = new Set(keys) as Set<string>
+
+  for (const [ key, value ] of Object.entries(object)) {
+    if (keysSet.has(key)) continue
+
+    result[key] = value
+  }
+
+  return result
+}
+
 function getKeys <O extends object, K extends keyof O> (object: O, keys: K[]): K[] {
   return (Object.keys(object) as K[]).filter(k => keys.includes(k))
 }
@@ -30,6 +43,7 @@ function sortObjectComparator (key: string, order: 'asc' | 'desc') {
 
 export {
   pick,
+  omit,
   getKeys,
   sortObjectComparator
 }
index b5ae9008e4ce63b631aa797e0e0a99e2d9b837f4..d8303848d6c678789b8bd60b66f2309ffba295c9 100644 (file)
@@ -1,5 +1,4 @@
-import { omit } from 'lodash'
-import { pick } from '@shared/core-utils'
+import { omit, pick } from '@shared/core-utils'
 import {
   HttpStatusCode,
   MyUser,
@@ -298,7 +297,7 @@ export class UsersCommand extends AbstractCommand {
   updateMe (options: OverrideCommandOptions & UserUpdateMe) {
     const path = '/api/v1/users/me'
 
-    const toSend: UserUpdateMe = omit(options, 'url', 'accessToken')
+    const toSend: UserUpdateMe = omit(options, [ 'expectedStatus', 'token' ])
 
     return this.putBodyRequest({
       ...options,
index 3df47ed4d7d8f2799ae84293b71668711197541f..d804fd883b53287b2656b1fe5e369525e4e60215 100644 (file)
@@ -1,9 +1,8 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import { readdir } from 'fs-extra'
-import { omit } from 'lodash'
 import { join } from 'path'
-import { wait } from '@shared/core-utils'
+import { omit, wait } from '@shared/core-utils'
 import {
   HttpStatusCode,
   LiveVideo,
@@ -103,7 +102,7 @@ export class LiveCommand extends AbstractCommand {
 
       path,
       attaches,
-      fields: omit(fields, 'thumbnailfile', 'previewfile'),
+      fields: omit(fields, [ 'thumbnailfile', 'previewfile' ]),
       implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     }))
index ce23900d39bd0590e3977fdf5e6e3e4abce6b1b3..516da0bf7b2de4dd9c09da1805fda0282fc437aa 100644 (file)
@@ -1,5 +1,4 @@
-import { omit } from 'lodash'
-import { pick } from '@shared/core-utils'
+import { omit, pick } from '@shared/core-utils'
 import {
   BooleanBothQuery,
   HttpStatusCode,
@@ -136,7 +135,7 @@ export class PlaylistsCommand extends AbstractCommand {
   }) {
     const path = '/api/v1/video-playlists'
 
-    const fields = omit(options.attributes, 'thumbnailfile')
+    const fields = omit(options.attributes, [ 'thumbnailfile' ])
 
     const attaches = options.attributes.thumbnailfile
       ? { thumbnailfile: options.attributes.thumbnailfile }
@@ -161,7 +160,7 @@ export class PlaylistsCommand extends AbstractCommand {
   }) {
     const path = '/api/v1/video-playlists/' + options.playlistId
 
-    const fields = omit(options.attributes, 'thumbnailfile')
+    const fields = omit(options.attributes, [ 'thumbnailfile' ])
 
     const attaches = options.attributes.thumbnailfile
       ? { thumbnailfile: options.attributes.thumbnailfile }
index c0b36d95bc5c3e196ba38f9207ea6df557cfbdd5..1683915234990b05572beb07c10edee2863426ae 100644 (file)
@@ -3,9 +3,8 @@
 import { expect } from 'chai'
 import { createReadStream, stat } from 'fs-extra'
 import got, { Response as GotResponse } from 'got'
-import { omit } from 'lodash'
 import validator from 'validator'
-import { buildAbsoluteFixturePath, pick, wait } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, omit, pick, wait } from '@shared/core-utils'
 import { buildUUID } from '@shared/extra-utils'
 import {
   HttpStatusCode,
@@ -484,7 +483,7 @@ export class VideosCommand extends AbstractCommand {
       },
 
       // Fixture will be sent later
-      attaches: this.buildUploadAttaches(omit(options.attributes, 'fixture')),
+      attaches: this.buildUploadAttaches(omit(options.attributes, [ 'fixture' ])),
       implicitToken: true,
 
       defaultExpectedStatus: null