UNPKG

ngx-webstorage-service

Version:
1 lines 28.7 kB
{"version":3,"file":"ngx-webstorage-service.mjs","sources":["../../../lib/src/proxy-storage.service.ts","../../../lib/src/base-storage.service.ts","../../../lib/src/storage-transcoders.ts","../../../lib/src/in-memory-storage.service.ts","../../../lib/src/web-storage.service.ts","../../../lib/src/storage-providers.ts","../../../lib/src/storage-service.module.ts","../../../lib/ngx-webstorage-service.ts"],"sourcesContent":["import { StorageService } from './storage.service';\nimport { StorageTranscoder, StorageDecoder, StorageEncoder } from './storage-transcoder';\n\n/**\n * A storage service implementation that is used as a proxy for another storage service. This is used to create storage services with a\n * different default transcoder.\n */\nexport class ProxyStorageService<T> implements StorageService<T> {\n\n /**\n * Creates a new `ProxyStorageService` instance that uses the specified transcoder by default for read and write operations. Actual\n * read and writes are delegated to given storage service.\n *\n * @param defaultTranscoder Transcoder which is to be used by default for storage read and write operations.\n * @param subject Storage service which should handle to actual storage of data.\n */\n constructor(\n private readonly defaultTranscoder: StorageTranscoder<T>,\n private readonly subject: StorageService,\n ) { }\n\n /**\n * Checks whether an entry with the specified key exists in the storage.\n *\n * @param key Identifier of the entry for which its presence in the storage is to be checked.\n * @returns `true` if an entry with the specified key exists in the storage, `false` if not.\n */\n public has(key: string): boolean {\n return this.subject.has(key);\n }\n\n /*\n * Retrieves the value stored for the entry that is associated with the specified key. The given decoder is used to convert the stored\n * value to the desired type. If no entry for the specified key exists or if the decoder is unable to decode the stored value, then\n * `undefined` will be returned.\n *\n * @param key Identifier of the entry whose value is to be retrieved.\n * @param decoder Decoder to use for converting the stored value to the desired return type.\n * @returns Value of the entry that is identified by the specified key. In case the entry does not exist or if it cannot be\n * loaded (due to a decoding issue), then `undefined` will be returned by this function.\n */\n public get(key: string, decoder?: StorageDecoder<any>): any {\n return this.subject.get(key, decoder ?? this.defaultTranscoder);\n }\n\n /**\n * Creates or updates the entry identified by the specified key with the given value. The specified encoder is used to convert the given\n * value into a format that can be stored by the storage service's underlying storage.\n *\n * Storing a value into the storage service will ensure that an equivalent of the value can be read back, i.e. the data and structure of\n * the value will be the same. It, however, does not necessarily return the same reference.\n *\n * @param key Identifier of the entry which is to be created or updated.\n * @param value Value which is to be stored.\n * @param encoder Encoder used to convert the given value into a format that can be used for storage.\n */\n public set(key: string, value: any, encoder?: StorageEncoder<any>): void {\n this.subject.set(key, value, encoder ?? this.defaultTranscoder);\n }\n\n /**\n * Removes the entry that is identified by the specified key. Attempting to remove an entry for an unknown key will have no effect.\n * Attempting to retrieve an entry via the `get` method after it has been removed will result in `undefined`.\n *\n * @param key Identifier of the entry which is to be removed.\n */\n public remove(key: string): void {\n this.subject.remove(key);\n }\n\n /**\n * Clears the storage by removing all entries. Subsequent `get(x)` calls for a key *x* will return `undefined`, until a new value is set\n * for key *x*.\n */\n public clear(): void {\n this.subject.clear();\n }\n\n /**\n * Creates a new storage service that uses the specified transcoder by default for read and write operations. The new storage service\n * uses the storage service on which this function is invoked as underlying storage. Both storage services will thus be able to access\n * the same data.\n *\n * The default transcoder will not be changed for the storage service on which this function is invoked.\n *\n * @param transcoder Transcoder that should be used by default for read and write operations by the new storage service.\n * @returns A new storage service that uses the specified transcoder by default.\n */\n public withDefaultTranscoder<X>(transcoder: StorageTranscoder<X>): StorageService<X> {\n return new ProxyStorageService(transcoder, this.subject);\n }\n}\n","import { StorageService } from './storage.service';\nimport { StorageDecoder, StorageEncoder, StorageTranscoder } from './storage-transcoder';\nimport { ProxyStorageService } from './proxy-storage.service';\n\n/**\n * Base implementation for storage services.\n */\nexport abstract class BaseStorageService<T> implements StorageService<T> {\n\n /**\n * Creates a new `BaseStorageService` that uses the specified transcoder by default for read and write operations.\n *\n * @param defaultTranscoder Transcoder which is to be used by default for storage read and write operations.\n */\n constructor(private readonly defaultTranscoder: StorageTranscoder<T>) {\n }\n\n /**\n * Checks whether an entry with the specified key exists in the storage.\n *\n * @param key Identifier of the entry for which its presence in the storage is to be checked.\n * @returns `true` if an entry with the specified key exists in the storage, `false` if not.\n */\n public abstract has(key: string): boolean;\n\n /**\n * Retrieves the value stored for the entry that is associated with the specified key. The given decoder is used to convert the stored\n * value to the desired type. If no entry for the specified key exists or if the decoder is unable to decode the stored value, then\n * `undefined` will be returned.\n *\n * @param key Identifier of the entry whose value is to be retrieved.\n * @param decoder Decoder to use for converting the stored value to the desired return type.\n * @returns Value of the entry that is identified by the specified key. In case the entry does not exist or if it cannot be\n * loaded (due to a decoding issue), then `undefined` will be returned by this function.\n */\n public get(key: string, decoder?: StorageDecoder<any>): any {\n const value = this.getItem(key);\n\n return value !== undefined ? (decoder ?? this.defaultTranscoder).decode(value) : undefined;\n }\n\n /**\n * Creates or updates the entry identified by the specified key with the given value. The specified encoder is used to convert the given\n * value into a format that can be stored by the storage service's underlying storage.\n *\n * Storing a value into the storage service will ensure that an equivalent of the value can be read back, i.e. the data and structure of\n * the value will be the same. It, however, does not necessarily return the same reference.\n *\n * @param key Identifier of the entry which is to be created or updated.\n * @param value Value which is to be stored.\n * @param encoder Encoder used to convert the given value into a format that can be used for storage.\n */\n public set(key: string, value: any, encoder?: StorageEncoder<any>): void {\n this.setItem(key, (encoder ?? this.defaultTranscoder).encode(value));\n }\n\n /**\n * Removes the entry that is identified by the specified key. Attempting to remove an entry for an unknown key will have no effect.\n * Attempting to retrieve an entry via the `get` method after it has been removed will result in `undefined`.\n *\n * @param key Identifier of the entry which is to be removed.\n */\n public abstract remove(key: string): void;\n\n /**\n * Clears the storage by removing all entries. Subsequent `get(x)` calls for a key *x* will return `undefined`, until a new value is set\n * for key *x*.\n */\n public abstract clear(): void;\n\n /**\n * Creates a new storage service that uses the specified transcoder by default for read and write operations. The new storage service\n * uses the storage service on which this function is invoked as underlying storage. Both storage services will thus be able to access\n * the same data.\n *\n * The default transcoder will not be changed for the storage service on which this function is invoked.\n *\n * @param transcoder Transcoder that should be used by default for read and write operations by the new storage service.\n * @returns A new storage service that uses the specified transcoder by default.\n */\n public withDefaultTranscoder<X>(transcoder: StorageTranscoder<X>): StorageService<X> {\n return new ProxyStorageService(transcoder, this);\n }\n\n /**\n * Performs the actual retrieval of a value from storage.\n *\n * @param key Identifier of the entry whose value is to be retrieved.\n * @returns The value that is stored for the specified entry or `undefined` if no entry exists for the specified key.\n */\n protected abstract getItem(key: string): string | undefined;\n\n /**\n * Stores the provided value using specified key in the storage.\n *\n * @param key Identifier of the entry for which the value is to be stored.\n * @param value The value that is to be stored.\n */\n protected abstract setItem(key: string, value: string): void;\n\n}\n","import { StorageTranscoder } from './storage-transcoder';\n\n/** Transcoder that encodes values as JSON strings. */\nexport class JsonStorageTranscoder implements StorageTranscoder<any> {\n\n public encode(value: any): string {\n return JSON.stringify(value);\n }\n\n public decode(value: string): any {\n try {\n return JSON.parse(value);\n } catch (error) {\n return undefined;\n }\n }\n\n}\n\n/** Transcoder that encodes/decodes strings **as is**, i.e. values are not modified in any way. */\nexport class StringStorageTranscoder implements StorageTranscoder<string> {\n public encode(value: string): string {\n return value;\n }\n\n public decode(value: string): string {\n return value;\n }\n}\n\n/** Transcoder that encodes/decodes `boolean` values. */\nexport class BooleanStorageTranscoder implements StorageTranscoder<boolean> {\n public encode(value: boolean): string {\n return value.toString();\n }\n\n public decode(value: string): boolean | undefined {\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n\n return undefined;\n }\n}\n\n/** Transcoder that encodes/decodes `number` values. */\nexport class NumberStorageTranscoder implements StorageTranscoder<number> {\n public encode(value: number): string {\n return value.toString();\n }\n\n public decode(value: string): number | undefined {\n const parsedNumber = Number(value);\n\n return Number.isFinite(parsedNumber) ? parsedNumber : undefined;\n }\n}\n\n/** Transcoder that encodes/decodes `Date` values to ISO strings. */\nexport class DateIsoStorageTranscoder implements StorageTranscoder<Date> {\n public encode(value: Date): string {\n return value.toISOString();\n }\n\n public decode(value: string): Date | undefined {\n const timestamp = Date.parse(value);\n\n return isNaN(timestamp) ? undefined : new Date(timestamp);\n }\n}\n\n/** Transcoder that encodes/decodes `Date` values to epoch timestamps. */\nexport class DateEpochStorageTranscoder implements StorageTranscoder<Date> {\n public encode(value: Date): string {\n return value.valueOf().toString();\n }\n\n public decode(value: string): Date | undefined {\n const timestamp = parseInt(value, 10);\n\n return isNaN(timestamp) ? undefined : new Date(timestamp);\n }\n}\n\n/** A set of storage transcoders. */\nexport const StorageTranscoders = {\n /** Transcoder that encodes values as JSON strings. */\n JSON: new JsonStorageTranscoder() as StorageTranscoder<any>,\n\n /** Transcoder that encodes/decodes strings **as is**, i.e. values are not modified in any way. */\n STRING: new StringStorageTranscoder() as StorageTranscoder<string>,\n\n /** Transcoder that encodes/decodes `boolean` values. */\n BOOLEAN: new BooleanStorageTranscoder() as StorageTranscoder<boolean>,\n\n /** Transcoder that encodes/decodes `number` values. */\n NUMBER: new NumberStorageTranscoder() as StorageTranscoder<number>,\n\n /** Transcoder that encodes/decodes `Date` values into ISO strings. */\n DATE_ISO_STRING: new DateIsoStorageTranscoder() as StorageTranscoder<Date>,\n\n /** Transcoder that encodes/decodes `Date` values into epoch timestamps. */\n DATE_EPOCH_TIME: new DateEpochStorageTranscoder() as StorageTranscoder<Date>,\n};\n","import { BaseStorageService } from './base-storage.service';\nimport { StorageTranscoders } from './storage-transcoders';\n\n/**\n * A volatile `StorageService` implementation. This service guarantees that data stored will remain available as long as the application\n * instance is active. After the application is terminated all data will be lost.\n */\nexport class InMemoryStorageService extends BaseStorageService<any> {\n\n /** A map that serves as the underlying backing storage for this service. */\n private readonly storage: Map<string, string> = new Map<string, string>();\n\n /**\n * Creates a new `InMemoryStorageService` instance.\n */\n constructor() {\n super(StorageTranscoders.JSON);\n }\n\n /**\n * Checks whether an entry with the specified key exists in the storage.\n *\n * @param key Identifier of the entry for which its presence in the storage is to be checked.\n * @returns `true` if an entry with the specified key exists in the storage, `false` if not.\n */\n public has(key: string): boolean {\n return this.storage.has(key);\n }\n\n /**\n * Removes the entry that is identified by the specified key. Attempting to remove an entry for an unknown key will have no effect.\n * Attempting to retrieve an entry via the `get` method after it has been removed will result in `undefined`.\n *\n * @param key Identifier of the entry which is to be removed.\n */\n public remove(key: string): void {\n this.storage.delete(key);\n }\n\n /**\n * Clears the storage by removing all entries. Subsequent `get(x)` calls for a key *x* will return `undefined`, until a new value is set\n * for key *x*.\n */\n public clear(): void {\n this.storage.clear();\n }\n\n /**\n * Performs the actual retrieval of a value from storage.\n *\n * @param key Identifier of the entry whose value is to be retrieved.\n * @returns The value that is stored for the specified entry or `undefined` if no entry exists for the specified key.\n */\n protected getItem(key: string): string | undefined {\n if (!this.storage.has(key)) {\n return undefined;\n }\n\n return this.storage.get(key)!;\n }\n\n /**\n * Stores the provided value using specified key in the storage.\n *\n * @param key Identifier of the entry for which the value is to be stored.\n * @param value The value that is to be stored.\n */\n protected setItem(key: string, value: string): void {\n this.storage.set(key, value);\n }\n\n}\n","import { BaseStorageService } from './base-storage.service';\nimport { StorageTranscoders } from './storage-transcoders';\n\n/**\n * An implementation of `StorageService` interface that uses an underlying (web) `Storage` object, such as `localStorage` and\n * `sessionStorage`, as backing data store. This class basically wraps the `Storage` object so it can be accessed through the\n * `StorageService` interface.\n */\nexport class WebStorageService extends BaseStorageService<any> {\n\n /**\n * Creates a new `WebStorageService` instance that uses the specified (web) storage object as underlying backing storage.\n *\n * @param storage Storage object which is to be wrapped in a class that implements the `StorageService` interface.\n */\n constructor(private readonly storage: Storage) {\n super(StorageTranscoders.JSON);\n }\n\n /**\n * Checks whether an entry with the specified key exists in the storage.\n *\n * @param key Identifier of the entry for which its presence in the storage is to be checked.\n * @returns `true` if an entry with the specified key exists in the storage, `false` if not.\n */\n public has(key: string): boolean {\n return this.storage.getItem(key) !== null;\n }\n\n /**\n * Removes the entry that is identified by the specified key. Attempting to remove an entry for an unknown key will have no effect.\n * Attempting to retrieve an entry via the `get` method after it has been removed will result in `undefined`.\n *\n * @param key Identifier of the entry which is to be removed.\n */\n public remove(key: string): void {\n this.storage.removeItem(key);\n }\n\n /**\n * Clears the storage by removing all entries. Subsequent `get(x)` calls for a key *x* will return `undefined`, until a new value is set\n * for key *x*.\n */\n public clear(): void {\n this.storage.clear();\n }\n\n /**\n * Performs the actual retrieval of a value from storage.\n *\n * @param key Identifier of the entry whose value is to be retrieved.\n * @returns The value that is stored for the specified entry or `undefined` if no entry exists for the specified key.\n */\n protected getItem(key: string): string | undefined {\n const value = this.storage.getItem(key);\n\n return value !== null ? value : undefined;\n }\n\n /**\n * Stores the provided value using specified key in the storage.\n *\n * @param key Identifier of the entry for which the value is to be stored.\n * @param value The value that is to be stored.\n */\n protected setItem(key: string, value: string): void {\n return this.storage.setItem(key, value);\n }\n\n}\n\n/**\n * Checks whether the specified (web) storage is available and functional. This might not be the case for older browsers. However even\n * certain browsers that do support the web storage API can, under some circumstances, have non functional storage objects. For example,\n * Safari is known to have `localStorage` and `sessionStorage` throw exceptions in private mode.\n *\n * @param storage Storage object which is to be tested for availability.\n * @returns `true` if the specified storage can be used, `false` if not.\n */\nexport function isStorageAvailable(storage: Storage): boolean {\n // Check if storage is available.\n if (!storage) {\n return false;\n }\n\n // Check if the storage can actually be accessed.\n try {\n const now = Date.now();\n const testItemKey = `storage-test-entry-${now}`;\n const testItemValue = `storage-test-value-${now}`;\n storage.setItem(testItemKey, testItemValue);\n const retrievedItemValue = storage.getItem(testItemKey);\n storage.removeItem(testItemKey);\n\n return retrievedItemValue === testItemValue;\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Checks whether session storage is available and functional. This might not be the case for older browsers. However even certain browsers\n * that do support the web storage API can, under some circumstances, have non functional storage objects. For example, Safari is known to\n * have `sessionStorage` throw exceptions in private mode.\n *\n * @returns `true` if session storage can be used, `false` if not.\n */\nexport function isSessionStorageAvailable(): boolean {\n try {\n if (typeof sessionStorage as any !== 'undefined') {\n return isStorageAvailable(sessionStorage);\n }\n } catch {}\n\n return false;\n}\n\n/**\n * Checks whether local storage is available and functional. This might not be the case for older browsers. However even certain browsers\n * that do support the web storage API can, under some circumstances, have non functional storage objects. For example, Safari is known to\n * have `localStorage` throw exceptions in private mode.\n *\n * @returns `true` if local storage can be used, `false` if not.\n */\nexport function isLocalStorageAvailable(): boolean {\n try {\n if (typeof localStorage as any !== 'undefined') {\n return isStorageAvailable(localStorage);\n }\n } catch {}\n\n return false;\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { InMemoryStorageService } from './in-memory-storage.service';\nimport { StorageService } from './storage.service';\nimport { WebStorageService, isLocalStorageAvailable, isSessionStorageAvailable } from './web-storage.service';\n\nexport function sessionStorageFactory(): StorageService {\n if (isSessionStorageAvailable()) {\n return new WebStorageService(sessionStorage);\n }\n\n return new InMemoryStorageService();\n}\n\n/** Injection token for the session storage service. */\nexport const SESSION_STORAGE = new InjectionToken<StorageService>(\n 'SESSION_STORAGE',\n { providedIn: 'root', factory: sessionStorageFactory },\n);\n\nexport function localStorageFactory(): StorageService {\n if (isLocalStorageAvailable()) {\n return new WebStorageService(localStorage);\n }\n\n return new InMemoryStorageService();\n}\n\n/** Injection token for the local storage service. */\nexport const LOCAL_STORAGE = new InjectionToken<StorageService>(\n 'LOCAL_STORAGE',\n { providedIn: 'root', factory: localStorageFactory },\n);\n","import { NgModule } from '@angular/core';\n\n/**\n * @deprecated You no longer need to import the `StorageServiceModule`, since the `SESSION_STORAGE` and `LOCAL_STORAGE` injection tokens are\n * now 'self providing' in the root injector.\n */\n@NgModule()\nexport class StorageServiceModule {\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAGA;;;;MAIa,mBAAmB;;;;;;;;IAS5B,YACqB,iBAAuC,EACvC,OAAuB;QADvB,sBAAiB,GAAjB,iBAAiB,CAAsB;QACvC,YAAO,GAAP,OAAO,CAAgB;KACvC;;;;;;;IAQE,GAAG,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAChC;;;;;;;;;;;IAYM,GAAG,CAAC,GAAW,EAAE,OAA6B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG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