Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nana Adjei Manu committed Mar 24, 2024
1 parent d080ab5 commit bbf5024
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LaunchLever, Toggle, isOn } from "./index";
import { LaunchLever, isOn } from "./index";
import { Toggle } from "./types";

const flags: Toggle[] = [
{
Expand Down
13 changes: 3 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
export interface Toggle {
name: string;
description: string;
status: "on" | "off";
}
import { Toggle, ToggleStatus, ToggleStatuses } from "./types";

type ToggleStatus = "on" | "off";
interface ToggleStatuses {
[key: string]: ToggleStatus;
export function isOn(status: ToggleStatus): boolean {
return status === "on";
}

export const isOn = (status: ToggleStatus): boolean => status === "on";

export class LaunchLever {
_flags: Toggle[] = [];
constructor(flags: Toggle[]) {
Expand Down
11 changes: 11 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface Toggle {
name: string;
description: string;
status: "on" | "off";
}

export type ToggleStatus = "on" | "off";

export interface ToggleStatuses {
[key: string]: ToggleStatus;
}
Empty file added types.ts
Empty file.

0 comments on commit bbf5024

Please sign in to comment.