Skip to content

Commit

Permalink
Remove dangling code
Browse files Browse the repository at this point in the history
  • Loading branch information
samayer12 committed Dec 13, 2024
1 parent 7d0762b commit 33bdbf4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
15 changes: 0 additions & 15 deletions src/lib/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { Binding, CapabilityExport } from "./types";
import { Event } from "./enums";
import {
addVerbIfNotExists,
bindingAndCapabilityNSConflict,
createRBACMap,
dedent,
Expand Down Expand Up @@ -358,20 +357,6 @@ describe("createRBACMap", () => {
});
});

describe("addVerbIfNotExists", () => {
it("should add a verb if it does not exist in the array", () => {
const verbs = ["get", "list"];
addVerbIfNotExists(verbs, "watch");
expect(verbs).toEqual(["get", "list", "watch"]);
});

it("should not add a verb if it already exists in the array", () => {
const verbs = ["get", "list", "watch"];
addVerbIfNotExists(verbs, "get");
expect(verbs).toEqual(["get", "list", "watch"]); // The array remains unchanged
});
});

describe("hasAnyOverlap", () => {
it("returns true for overlapping arrays", () => {
expect(hasAnyOverlap([1, 2, 3], [3, 4, 5])).toBe(true);
Expand Down
6 changes: 0 additions & 6 deletions src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ type RBACMap = {
};
};

export function addVerbIfNotExists(verbs: string[], verb: string): void {
if (!verbs.includes(verb)) {
verbs.push(verb);
}
}

export function createRBACMap(capabilities: CapabilityExport[]): RBACMap {
return capabilities.reduce((acc: RBACMap, capability: CapabilityExport) => {
capability.bindings.forEach(binding => {
Expand Down

0 comments on commit 33bdbf4

Please sign in to comment.