Skip to content

Commit

Permalink
feat(checks): add hasPerformance() check (performance.now)
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 7, 2018
1 parent d310345 commit 40d706b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/checks/src/has-performance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { isFunction } from "./is-function";

export function hasPerformance() {
return typeof performance !== 'undefined' && isFunction(performance.now);
}
1 change: 1 addition & 0 deletions packages/checks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from "./exists";
export * from "./has-crypto";
export * from "./has-max-length";
export * from "./has-min-length";
export * from "./has-performance";
export * from "./has-wasm";
export * from "./has-webgl";
export * from "./has-websocket";
Expand Down

0 comments on commit 40d706b

Please sign in to comment.