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

@ionic/storage

Package Overview
Dependencies
Maintainers
8
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/storage - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

38

es2015/storage.d.ts

@@ -1,2 +0,1 @@

/// <reference types="localforage" />
/**

@@ -57,9 +56,12 @@ * Storage is an easy way to store key/value pairs and JSON objects.

*
* // set a key/value
* storage.set('name', 'Max');
* storage.ready().then(() => {
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* // set a key/value
* storage.set('name', 'Max');
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* });
* }

@@ -79,3 +81,3 @@ * }

* export function provideStorage() {
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' }// optional config);
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' });
* }

@@ -97,2 +99,3 @@ *

private _dbPromise;
private _driver;
/**

@@ -106,6 +109,16 @@ * Create a new Storage instance using the order of drivers and any additional config

constructor(driverOrder?: [string], config?: any);
/**
* Get the name of the driver being used.
* @return Name of the driver
*/
readonly driver: string;
/**
* Reflect the readiness of the store.
* @return Promise that resolves when the store is ready
*/
ready(): Promise<LocalForage>;
_getDriverOrder(driverOrder: any): any;
/**
* Get the value assocated with the given key.
* Get the value associated with the given key.
* @param key the key to identify this value
* @return Promise that resolves with the value

@@ -129,11 +142,11 @@ */

* Clear the entire key value store. WARNING: HOT!
* @return Promise that resolves when the kv store is cleared
* @return Promise that resolves when the store is cleared
*/
clear(): Promise<null>;
/**
* @return the number of keys stored.
* @return Promise that resolves with the number of keys stored.
*/
length(): Promise<number>;
/**
* @return the keys in the store.
* @return Promise that resolves with the keys in the store.
*/

@@ -144,4 +157,5 @@ keys(): Promise<string[]>;

* @param iteratorCallback a callback of the form (value, key, iterationNumber)
* @return Promise that resolves when the iteration has finished.
*/
forEach(iteratorCallback: (value: any, key: string, iterationNumber: Number) => any): Promise<null>;
}

@@ -65,9 +65,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

*
* // set a key/value
* storage.set('name', 'Max');
* storage.ready().then(() => {
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* // set a key/value
* storage.set('name', 'Max');
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* });
* }

@@ -87,3 +90,3 @@ * }

* export function provideStorage() {
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' }// optional config);
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' });
* }

@@ -103,3 +106,3 @@ *

*/
var Storage = (function () {
export var Storage = (function () {
/**

@@ -113,4 +116,5 @@ * Create a new Storage instance using the order of drivers and any additional config

function Storage(driverOrder, config) {
var _this = this;
if (driverOrder === void 0) { driverOrder = ['sqlite', 'indexeddb', 'websql', 'localstorage']; }
var _this = this;
this._driver = null;
this._dbPromise = new Promise(function (resolve, reject) {

@@ -133,3 +137,3 @@ var db;

.then(function () {
console.info('Ionic Storage driver:', db.driver());
_this._driver = db.driver();
resolve(db);

@@ -140,2 +144,17 @@ })

}
Object.defineProperty(Storage.prototype, "driver", {
/**
* Get the name of the driver being used.
* @return Name of the driver
*/
get: function () {
return this._driver;
},
enumerable: true,
configurable: true
});
/**
* Reflect the readiness of the store.
* @return Promise that resolves when the store is ready
*/
Storage.prototype.ready = function () {

@@ -159,3 +178,4 @@ return this._dbPromise;

/**
* Get the value assocated with the given key.
* Get the value associated with the given key.
* @param key the key to identify this value
* @return Promise that resolves with the value

@@ -185,3 +205,3 @@ */

* Clear the entire key value store. WARNING: HOT!
* @return Promise that resolves when the kv store is cleared
* @return Promise that resolves when the store is cleared
*/

@@ -192,3 +212,3 @@ Storage.prototype.clear = function () {

/**
* @return the number of keys stored.
* @return Promise that resolves with the number of keys stored.
*/

@@ -199,3 +219,3 @@ Storage.prototype.length = function () {

/**
* @return the keys in the store.
* @return Promise that resolves with the keys in the store.
*/

@@ -208,2 +228,3 @@ Storage.prototype.keys = function () {

* @param iteratorCallback a callback of the form (value, key, iterationNumber)
* @return Promise that resolves when the iteration has finished.
*/

@@ -213,7 +234,6 @@ Storage.prototype.forEach = function (iteratorCallback) {

};
Storage = __decorate([
Injectable()
], Storage);
return Storage;
}());
Storage = __decorate([
Injectable()
], Storage);
export { Storage };
"use strict";
var storage_1 = require("./storage");
var storage_1 = require('./storage');
exports.Storage = storage_1.Storage;

@@ -1,2 +0,1 @@

/// <reference types="localforage" />
/**

@@ -57,9 +56,12 @@ * Storage is an easy way to store key/value pairs and JSON objects.

*
* // set a key/value
* storage.set('name', 'Max');
* storage.ready().then(() => {
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* // set a key/value
* storage.set('name', 'Max');
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* });
* }

@@ -79,3 +81,3 @@ * }

* export function provideStorage() {
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' }// optional config);
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' });
* }

@@ -97,2 +99,3 @@ *

private _dbPromise;
private _driver;
/**

@@ -106,6 +109,16 @@ * Create a new Storage instance using the order of drivers and any additional config

constructor(driverOrder?: [string], config?: any);
/**
* Get the name of the driver being used.
* @return Name of the driver
*/
readonly driver: string;
/**
* Reflect the readiness of the store.
* @return Promise that resolves when the store is ready
*/
ready(): Promise<LocalForage>;
_getDriverOrder(driverOrder: any): any;
/**
* Get the value assocated with the given key.
* Get the value associated with the given key.
* @param key the key to identify this value
* @return Promise that resolves with the value

@@ -129,11 +142,11 @@ */

* Clear the entire key value store. WARNING: HOT!
* @return Promise that resolves when the kv store is cleared
* @return Promise that resolves when the store is cleared
*/
clear(): Promise<null>;
/**
* @return the number of keys stored.
* @return Promise that resolves with the number of keys stored.
*/
length(): Promise<number>;
/**
* @return the keys in the store.
* @return Promise that resolves with the keys in the store.
*/

@@ -144,4 +157,5 @@ keys(): Promise<string[]>;

* @param iteratorCallback a callback of the form (value, key, iterationNumber)
* @return Promise that resolves when the iteration has finished.
*/
forEach(iteratorCallback: (value: any, key: string, iterationNumber: Number) => any): Promise<null>;
}

@@ -8,5 +8,5 @@ "use strict";

};
var core_1 = require("@angular/core");
var localforage_1 = require("localforage");
var localforage_cordovasqlitedriver_1 = require("localforage-cordovasqlitedriver");
var core_1 = require('@angular/core');
var localforage_1 = require('localforage');
var localforage_cordovasqlitedriver_1 = require('localforage-cordovasqlitedriver');
/**

@@ -67,9 +67,12 @@ * Storage is an easy way to store key/value pairs and JSON objects.

*
* // set a key/value
* storage.set('name', 'Max');
* storage.ready().then(() => {
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* // set a key/value
* storage.set('name', 'Max');
*
* // Or to get a key/value pair
* storage.get('name').then((val) => {
* console.log('Your name is', val);
* })
* });
* }

@@ -89,3 +92,3 @@ * }

* export function provideStorage() {
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' }// optional config);
* return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '__mydb' });
* }

@@ -114,4 +117,5 @@ *

function Storage(driverOrder, config) {
var _this = this;
if (driverOrder === void 0) { driverOrder = ['sqlite', 'indexeddb', 'websql', 'localstorage']; }
var _this = this;
this._driver = null;
this._dbPromise = new Promise(function (resolve, reject) {

@@ -134,3 +138,3 @@ var db;

.then(function () {
console.info('Ionic Storage driver:', db.driver());
_this._driver = db.driver();
resolve(db);

@@ -141,2 +145,17 @@ })

}
Object.defineProperty(Storage.prototype, "driver", {
/**
* Get the name of the driver being used.
* @return Name of the driver
*/
get: function () {
return this._driver;
},
enumerable: true,
configurable: true
});
/**
* Reflect the readiness of the store.
* @return Promise that resolves when the store is ready
*/
Storage.prototype.ready = function () {

@@ -160,3 +179,4 @@ return this._dbPromise;

/**
* Get the value assocated with the given key.
* Get the value associated with the given key.
* @param key the key to identify this value
* @return Promise that resolves with the value

@@ -186,3 +206,3 @@ */

* Clear the entire key value store. WARNING: HOT!
* @return Promise that resolves when the kv store is cleared
* @return Promise that resolves when the store is cleared
*/

@@ -193,3 +213,3 @@ Storage.prototype.clear = function () {

/**
* @return the number of keys stored.
* @return Promise that resolves with the number of keys stored.
*/

@@ -200,3 +220,3 @@ Storage.prototype.length = function () {

/**
* @return the keys in the store.
* @return Promise that resolves with the keys in the store.
*/

@@ -209,2 +229,3 @@ Storage.prototype.keys = function () {

* @param iteratorCallback a callback of the form (value, key, iterationNumber)
* @return Promise that resolves when the iteration has finished.
*/

@@ -214,7 +235,7 @@ Storage.prototype.forEach = function (iteratorCallback) {

};
Storage = __decorate([
core_1.Injectable()
], Storage);
return Storage;
}());
Storage = __decorate([
core_1.Injectable()
], Storage);
exports.Storage = Storage;
{
"name": "@ionic/storage",
"version": "1.1.7",
"version": "1.1.8",
"description": "Ionic Storage utility",

@@ -34,8 +34,10 @@ "main": "es2015/index.js",

"dependencies": {
"@angular/core": "^2.0.0",
"@types/localforage": "0.0.30",
"localforage": "^1.4.2",
"localforage-cordovasqlitedriver": "^1.5.0",
"rxjs": "5.0.0-beta.12"
"localforage": "~1.4.2",
"localforage-cordovasqlitedriver": "~1.5.0"
},
"peerDependencies": {
"@angular/core": "*",
"rxjs": "*"
}
}
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