File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -191,8 +191,10 @@ export class Publisher {
191191 // We must have at least one of:
192192 // - `data` as a Buffer
193193 // - `attributes` that are not empty
194- if ( data && ! ( data instanceof Buffer ) ) {
195- throw new TypeError ( 'Data must be in the form of a Buffer.' ) ;
194+ if ( data && ! ( data instanceof Uint8Array ) ) {
195+ throw new TypeError (
196+ 'Data must be in the form of a Buffer or Uint8Array.'
197+ ) ;
196198 }
197199
198200 const keys = Object . keys ( attributes ! ) ;
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ describe('Publisher', () => {
237237 const badData = { } as Buffer ;
238238 assert . throws (
239239 ( ) => publisher . publishMessage ( { data : badData } , spy ) ,
240- / D a t a m u s t b e i n t h e f o r m o f a B u f f e r \. /
240+ / D a t a m u s t b e i n t h e f o r m o f a B u f f e r o r U i n t 8 A r r a y \. /
241241 ) ;
242242 } ) ;
243243
Original file line number Diff line number Diff line change @@ -689,7 +689,10 @@ describe('PubSub', () => {
689689 const apiResponse = {
690690 name : 'new-topic' ,
691691 } ;
692- let requestStub : sinon . SinonStub < unknown [ ] , unknown > ;
692+
693+ // Types changed, so this is needed instead of `unknown`.
694+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
695+ let requestStub : sinon . SinonStub < any [ ] , any > ;
693696
694697 beforeEach ( ( ) => {
695698 requestStub = sandbox
You can’t perform that action at this time.
0 commit comments