πŸ“„ File detail

utils/secureStorage/index.ts

🧩 .tsπŸ“ 18 linesπŸ’Ύ 559 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œutils/”, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, …). On the API surface it exposes getSecureStorage β€” mainly functions, hooks, or classes. It composes internal code from fallbackStorage, macOsKeychainStorage, plainTextStorage, and types (relative imports).

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

import { createFallbackStorage } from './fallbackStorage.js' import { macOsKeychainStorage } from './macOsKeychainStorage.js' import { plainTextStorage } from './plainTextStorage.js' import type { SecureStorage } from './types.js'

πŸ“€ Exports (heuristic)

  • getSecureStorage

πŸ–₯️ Source preview

import { createFallbackStorage } from './fallbackStorage.js'
import { macOsKeychainStorage } from './macOsKeychainStorage.js'
import { plainTextStorage } from './plainTextStorage.js'
import type { SecureStorage } from './types.js'

/**
 * Get the appropriate secure storage implementation for the current platform
 */
export function getSecureStorage(): SecureStorage {
  if (process.platform === 'darwin') {
    return createFallbackStorage(macOsKeychainStorage, plainTextStorage)
  }

  // TODO: add libsecret support for Linux

  return plainTextStorage
}