Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngx-pwa/local-storage

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngx-pwa/local-storage - npm Package Versions

1
13

8.0.1

Diff

Changelog

Source

6.2.4 & 8.0.1 (2019-06-05)

Bug fix

  • When storage is fully disabled in browser (via the "Block all cookies" option), just trying to check indexedDB or localStorage variables causes a security exception, and all Angular code will fail. So the library is now catching the error, and fallbacks to in-memory storage in this case.
cyrilletuzi
published 8.0.0 •

Changelog

Source

8.0.0 (2019-05-29)

A full migration guide to version 8 is available.

Angular 8

v8 requires Angular 8.

Feature: new StorageMap service

See the general documentation.

Feature: validation is much easier!

  • The schema used for validation can (and should) be passed directly as the second argument of getItem()
  • The returned type of getItem() is now inferred for basic types (string, number, boolean) and arrays of basic types (string[], number[], boolean[])
  • Just use the new JSONSchema interface, IntelliSense will adjust itself based on the type option

See the new validation guide.

Full review

This library started as a little project and is now the first Angular library used for client-side storage. It was time to do a full review and refactoring, which results in:

  • Better error management (see README)
  • Better documentation
  • Better overall code (= easier to contribute)

Other features

  • indexedDB database and object store names default values are exported and can be changed (see the interoperability guide)
  • When trying to store null or undefined, removeItem() instead of just bypassing (meaning the old value was kept)

Breaking changes

  • type now required for array, object, const and enum validation schemas
  • JSONSchemaNull removed (useless, null does not require any validation)
  • JSONSchema no longer accepts extra properties
  • getUnsafeItem() is removed (was already deprecated in v7)

Future breaking changes

  • .has(), .keys() and .size are deprecated in LocalStorage. They will be removed in v9. They moved to the new StorageMap service.
  • JSONSchemaNumeric deprecated (will be removed in v9)
  • LSGetItemsOptions deprecated (not necessary anymore, will be removed in v9)
  • LOCAL_STORAGE_PREFIX, LocalStorageProvidersConfig and localStorageProviders() deprecated (will be removed in v9). Moved to StorageModule.forRoot()
  • setItemSubscribe(), removeItemSubscribe() and clearSubscribe() deprecated (will be removed in v9)

Reduced public API

Should not concern you as it was internal stuff.

  • IndexedDBDatabase and LocalStorageDatabase not exported anymore
  • MockLocalDatabase renamed and not exported anymore
cyrilletuzi
published 8.0.0-rc.0 •

cyrilletuzi
published 8.0.0-beta.13 •

cyrilletuzi
published 8.0.0-beta.12 •

cyrilletuzi
published 8.0.0-beta.11 •

cyrilletuzi
published 8.0.0-beta.10 •

cyrilletuzi
published 8.0.0-beta.9 •

cyrilletuzi
published 8.0.0-beta.8 •

cyrilletuzi
published 8.0.0-beta.7 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc