Skip to content

Commit 808c905

Browse files
authored
Merge pull request #109 from smarr/remove-use-of-window
Remove use of window to check for Float64Array
2 parents 0aa1ccc + 45e8ff9 commit 808c905

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function determineStatsOptions(options?: IBaseOptions) {
203203
*/
204204
export function boxplotStats(arr: readonly number[] | Float32Array | Float64Array, options: IBaseOptions): IBoxPlot {
205205
const vs =
206-
window.Float64Array != null && !(arr instanceof Float32Array || arr instanceof Float64Array)
206+
typeof Float64Array !== 'undefined' && !(arr instanceof Float32Array || arr instanceof Float64Array)
207207
? Float64Array.from(arr)
208208
: arr;
209209
const r = boxplots(vs, determineStatsOptions(options));
@@ -244,7 +244,7 @@ export function violinStats(arr: readonly number[], options: IViolinOptions): IV
244244
return undefined;
245245
}
246246
const vs =
247-
window.Float64Array != null && !(arr instanceof Float32Array || arr instanceof Float64Array)
247+
typeof Float64Array !== 'undefined' && !(arr instanceof Float32Array || arr instanceof Float64Array)
248248
? Float64Array.from(arr)
249249
: arr;
250250
const stats = boxplots(vs, determineStatsOptions(options));

0 commit comments

Comments
 (0)