| 82 | * LocalStorageStore to our SyncKeyValueFileSystem. |
| 83 | */ |
| 84 | export default class LocalStorageFileSystem extends SyncKeyValueFileSystem { |
| 85 | public static readonly Name = "LocalStorage"; |
| 86 | |
| 87 | public static readonly Options: FileSystemOptions = {}; |
| 88 | |
| 89 | /** |
| 90 | * Creates a LocalStorageFileSystem instance. |
| 91 | */ |
| 92 | public static Create(options: any, cb: BFSCallback<LocalStorageFileSystem>): void { |
| 93 | cb(null, new LocalStorageFileSystem()); |
| 94 | } |
| 95 | public static isAvailable(): boolean { |
| 96 | return typeof global.localStorage !== 'undefined'; |
| 97 | } |
| 98 | /** |
| 99 | * Creates a new LocalStorage file system using the contents of `localStorage`. |
| 100 | */ |
| 101 | constructor() { super({ store: new LocalStorageStore() }); } |
| 102 | } |
nothing calls this directly
no outgoing calls
no test coverage detected