@vltpkg/keychain 1.0.0-rc.27 → 1.0.0-rc.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export declare class Keychain<V extends string = string> {
8
8
  load(): Promise<void>;
9
9
  has(key: string): Promise<boolean>;
10
10
  hasSync(key: string): boolean;
11
+ keys(): Promise<string[]>;
12
+ keysSync(): string[];
11
13
  set(key: string, value: V): void;
12
14
  delete(key: string): void;
13
15
  save(): Promise<void>;
package/dist/index.js CHANGED
@@ -49,6 +49,12 @@ export class Keychain {
49
49
  hasSync(key) {
50
50
  return !!this.#data && Object.hasOwn(this.#data, key);
51
51
  }
52
+ async keys() {
53
+ return (await this.#load()).keysSync();
54
+ }
55
+ keysSync() {
56
+ return this.#data ? Object.keys(this.#data) : [];
57
+ }
52
58
  async #mkdir() {
53
59
  await mkdir(dirname(this.#file), {
54
60
  recursive: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/keychain",
3
3
  "description": "The filesystem keychain for `@vltpkg/registry-client`",
4
- "version": "1.0.0-rc.27",
4
+ "version": "1.0.0-rc.29",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,7 +13,7 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/xdg": "1.0.0-rc.27"
16
+ "@vltpkg/xdg": "1.0.0-rc.29"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@eslint/js": "^9.39.1",