File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/firestore/src/platform_browser Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import { ConnectivityMonitor } from './../remote/connectivity_monitor';
24
24
import { NoopConnectivityMonitor } from '../remote/connectivity_monitor_noop' ;
25
25
import { BrowserConnectivityMonitor } from './browser_connectivity_monitor' ;
26
26
import { WebChannelConnection } from './webchannel_connection' ;
27
- import { validatePositiveNumber } from '../util/input_validation ' ;
27
+ import { debugAssert } from '../util/assert ' ;
28
28
29
29
// Implements the Platform API for browsers and some browser-like environments
30
30
// (including ReactNative).
@@ -76,10 +76,11 @@ export class BrowserPlatform implements Platform {
76
76
}
77
77
78
78
randomBytes ( nBytes : number ) : Uint8Array {
79
- validatePositiveNumber ( 'randomBytes' , 1 , nBytes ) ;
79
+ debugAssert ( nBytes >= 0 , 'Number of random bytes must not be negative' ) ;
80
80
81
81
// Polyfill for IE and WebWorker
82
82
const crypto =
83
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
84
typeof self !== 'undefined' && ( self . crypto || ( self as any ) [ 'msCrypto' ] ) ;
84
85
const v = new Uint8Array ( nBytes ) ;
85
86
if ( crypto ) {
You can’t perform that action at this time.
0 commit comments