Skip to content

Commit

Permalink
Move OFFSET constants closer to their scope
Browse files Browse the repository at this point in the history
  • Loading branch information
yamiteru committed Apr 3, 2023
1 parent fc67027 commit 9aa4ce5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Offset, Offsets, Options, Store, Stores } from "./types";

export const OFFSET_KEYS = ["min", "max", "median"] as const;

export const OFFSET_MAX = OFFSET_KEYS.length;

// Empty async function used to determine the overhead of async functions
export const FN_ASYNC = async () => {
/* */
};
Expand Down
5 changes: 3 additions & 2 deletions src/offset/getOffset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import {
FN_SYNC,
OFFSET,
OFFSETS,
OFFSET_KEYS,
OFFSET_MAX,
} from "../constants";
import { Name } from "../events";
import { stats } from "../stats";
import { TypeMode } from "../types";

const OFFSET_KEYS = ["min", "max", "median"] as const;
const OFFSET_MAX = OFFSET_KEYS.length;

export async function getOffset(name: Name, { type, mode }: TypeMode) {
const fn = type === "async" ? FN_ASYNC : FN_SYNC;
const result = { ...OFFSET };
Expand Down

0 comments on commit 9aa4ce5

Please sign in to comment.