Skip to content

Commit

Permalink
Remove support createAssembly callback check (#195)
Browse files Browse the repository at this point in the history
Users have had time to migrate. Also the type definitions don’t allow
it.
  • Loading branch information
remcohaszing authored Oct 21, 2024
1 parent b012060 commit 65d7cf2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
9 changes: 1 addition & 8 deletions src/Transloadit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,7 @@ export class Transloadit {
*
* @param opts assembly options
*/
createAssembly(opts: CreateAssemblyOptions = {}, arg2?: void): CreateAssemblyPromise {
// Warn users of old callback API
if (typeof arg2 === 'function') {
throw new TypeError(
'You are trying to send a function as the second argument. This is no longer valid in this version. Please see github README for usage.'
)
}

createAssembly(opts: CreateAssemblyOptions = {}): CreateAssemblyPromise {
const {
params = {},
waitForCompletion = false,
Expand Down
12 changes: 0 additions & 12 deletions test/unit/test-transloadit-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,18 +287,6 @@ describe('Transloadit', () => {
)
})

it('should crash if attempt to use callback', async () => {
const client = new Transloadit({ authKey: 'foo_key', authSecret: 'foo_secret' })
const cb = () => {}
expect(() =>
client.createAssembly(
{},
// @ts-expect-error This tests bad input
cb
)
).toThrow(TypeError)
})

describe('_calcSignature', () => {
it('should calculate the signature properly', () => {
const client = new Transloadit({ authKey: 'foo_key', authSecret: 'foo_secret' })
Expand Down

0 comments on commit 65d7cf2

Please sign in to comment.