Remove unused method
This commit is contained in:
parent
0230f32aab
commit
c93250f8e8
20
src/vault.ts
20
src/vault.ts
@ -72,7 +72,10 @@ export class Vault {
|
||||
}
|
||||
},
|
||||
|
||||
values: () => Array.from(this.#overviews.values()),
|
||||
values: () => {
|
||||
this.#assertUnlocked()
|
||||
return Array.from(this.#overviews.values())
|
||||
},
|
||||
})
|
||||
|
||||
/**
|
||||
@ -127,21 +130,6 @@ export class Vault {
|
||||
}
|
||||
}
|
||||
|
||||
getOverview(title: string): Overview
|
||||
getOverview(predicate: (overview: Overview) => boolean): Overview
|
||||
|
||||
getOverview(condition: string | ((overview: Overview) => boolean)) {
|
||||
if (typeof condition === "string") {
|
||||
const title = condition
|
||||
condition = overview => overview.title === title
|
||||
}
|
||||
for (const value of this.#overviews.values()) {
|
||||
if (condition(value)) {
|
||||
return value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getItem(uuid: string) {
|
||||
this.#assertUnlocked()
|
||||
const encrypted = uuid ? this.#bands.get(uuid[0])![uuid] : undefined
|
||||
|
@ -38,5 +38,16 @@ describe("OnePassword", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("lock", () => {});
|
||||
describe("lock", () => {
|
||||
it("locks", async () => {
|
||||
const instance = new OnePassword({ path: freddy });
|
||||
const vault = await instance.getProfile("default");
|
||||
vault.unlock("freddy");
|
||||
expect(vault.isLocked).to.be.false;
|
||||
|
||||
vault.lock();
|
||||
expect(vault.isLocked).to.be.true;
|
||||
expect(() => vault.overviews.values()).to.throw();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user