Skip to content

Commit

Permalink
Merge pull request #109 from smarr/remove-use-of-window
Browse files Browse the repository at this point in the history
Remove use of window to check for Float64Array
  • Loading branch information
sgratzl committed Mar 24, 2024
2 parents 0aa1ccc + 45e8ff9 commit 808c905
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function determineStatsOptions(options?: IBaseOptions) {
*/
export function boxplotStats(arr: readonly number[] | Float32Array | Float64Array, options: IBaseOptions): IBoxPlot {
const vs =
window.Float64Array != null && !(arr instanceof Float32Array || arr instanceof Float64Array)
typeof Float64Array !== 'undefined' && !(arr instanceof Float32Array || arr instanceof Float64Array)
? Float64Array.from(arr)
: arr;
const r = boxplots(vs, determineStatsOptions(options));
Expand Down Expand Up @@ -244,7 +244,7 @@ export function violinStats(arr: readonly number[], options: IViolinOptions): IV
return undefined;
}
const vs =
window.Float64Array != null && !(arr instanceof Float32Array || arr instanceof Float64Array)
typeof Float64Array !== 'undefined' && !(arr instanceof Float32Array || arr instanceof Float64Array)
? Float64Array.from(arr)
: arr;
const stats = boxplots(vs, determineStatsOptions(options));
Expand Down

0 comments on commit 808c905

Please sign in to comment.