Socket
Socket
Sign inDemoInstall

kinvey-html5-sdk

Package Overview
Dependencies
Maintainers
2
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kinvey-html5-sdk - npm Package Compare versions

Comparing version 3.9.0-beta.2 to 3.9.0

package-lock.json

51

dist/middleware/src/storage/webstorage.js

@@ -32,6 +32,2 @@ 'use strict';

var _findIndex = require('lodash/findIndex');
var _findIndex2 = _interopRequireDefault(_findIndex);
var _find2 = require('lodash/find');

@@ -129,3 +125,3 @@

return this._find(this.masterCollectionName).then(function (collections) {
if ((0, _findIndex2.default)(collections, collection) === -1) {
if (collections.indexOf(collection) === -1) {
collections.push(collection);

@@ -147,2 +143,4 @@ global.localStorage.setItem(_this3.masterCollectionName, JSON.stringify(collections));

entitiesById[id] = (0, _merge2.default)(existingEntity, entity);
} else {
entitiesById[id] = existingEntity;
}

@@ -169,5 +167,4 @@ });

delete entitiesById[id];
return _this4.save(collection, (0, _values2.default)(entitiesById)).then(function () {
return { count: 1 };
});
global.localStorage.setItem('' + _this4.name + collection, JSON.stringify((0, _values2.default)(entitiesById)));
return { count: 1 };
});

@@ -219,5 +216,5 @@ }

var masterCollection = global.localStorage.getItem(_this6.masterCollectionName);
var masterCollection = global.sessionStorage.getItem(_this6.masterCollectionName);
if ((0, _export.isDefined)(masterCollection) === false) {
global.localStorage.setItem(_this6.masterCollectionName, JSON.stringify([]));
global.sessionStorage.setItem(_this6.masterCollectionName, JSON.stringify([]));
}

@@ -231,3 +228,3 @@ return _this6;

try {
var entities = global.localStorage.getItem(collection);
var entities = global.sessionStorage.getItem(collection);

@@ -271,3 +268,3 @@ if ((0, _export.isDefined)(entities)) {

return this._find(this.masterCollectionName).then(function (collections) {
if ((0, _findIndex2.default)(collections, collection) === -1) {
if (collections.indexOf(collection) === -1) {
collections.push(collection);

@@ -289,2 +286,4 @@ global.sessionStorage.setItem(_this8.masterCollectionName, JSON.stringify(collections));

entitiesById[id] = (0, _merge2.default)(existingEntity, entity);
} else {
entitiesById[id] = existingEntity;
}

@@ -311,5 +310,4 @@ });

delete entitiesById[id];
return _this9.save(collection, (0, _values2.default)(entitiesById)).then(function () {
return { count: 1 };
});
global.sessionStorage.setItem('' + _this9.name + collection, JSON.stringify((0, _values2.default)(entitiesById)));
return { count: 1 };
});

@@ -361,3 +359,3 @@ }

var values = document.cookie.split(';');
var values = global.document.cookie.split(';');
for (var i = 0, len = values.length; i < len; i += 1) {

@@ -384,3 +382,3 @@ var value = values[i];

value: function _find(collection) {
var values = document.cookie.split(';');
var values = global.document.cookie.split(';');
for (var i = 0, len = values.length; i < len; i += 1) {

@@ -392,3 +390,3 @@ var value = values[i];

if (value.indexOf(collection) === 0) {
return _es6Promise2.default.resolve(JSON.parse(decodeURIComponent(value.substring(collection.length, value.length))));
return _es6Promise2.default.resolve(JSON.parse(decodeURIComponent(value.substring(collection.length + 1, value.length))));
}

@@ -426,3 +424,3 @@ }

return this._find(this.masterCollectionName).then(function (collections) {
if ((0, _findIndex2.default)(collections, collection) === -1) {
if (collections.indexOf(collection) === -1) {
collections.push(collection);

@@ -437,4 +435,4 @@ var expires = new Date();

var existingEntitiesById = (0, _keyBy2.default)(existingEntities, idAttribute);
var existingEntityIds = Object.keys(existingEntitiesById);
var entitiesById = (0, _keyBy2.default)(entities, idAttribute);
var existingEntityIds = Object.keys(existingEntitiesById);

@@ -447,2 +445,4 @@ (0, _forEach2.default)(existingEntityIds, function (id) {

entitiesById[id] = (0, _merge2.default)(existingEntity, entity);
} else {
entitiesById[id] = existingEntity;
}

@@ -471,5 +471,6 @@ });

delete entitiesById[id];
return _this14.save(collection, (0, _values2.default)(entitiesById)).then(function () {
return { count: 1 };
});
var expires = new Date();
expires.setTime(expires.getTime() + 100 * 365 * 24 * 60 * 60 * 1000); // Expire in 100 years
global.document.cookie = '' + _this14.name + collection + '=' + encodeURIComponent(JSON.stringify((0, _values2.default)(entitiesById))) + '; expires=' + expires.toUTCString() + '; path=/';
return { count: 1 };
});

@@ -486,3 +487,3 @@ }

expires.setTime(expires.getTime() + 100 * 365 * 24 * 60 * 60 * 1000); // Expire in 100 years
global.document.cookie = '' + _this15.name + collection + '=' + encodeURIComponent() + '; expires=' + expires.toUTCString() + '; path=/';
global.document.cookie = '' + _this15.name + collection + '=' + encodeURIComponent(JSON.stringify([])) + '; expires=' + expires.toUTCString() + '; path=/';
});

@@ -492,3 +493,3 @@

expires.setTime(expires.getTime() + 100 * 365 * 24 * 60 * 60 * 1000); // Expire in 100 years
global.document.cookie = _this15.masterCollectionName + '=' + encodeURIComponent() + '; expires=' + expires.toUTCString() + '; path=/';
global.document.cookie = _this15.masterCollectionName + '=' + encodeURIComponent(JSON.stringify([])) + '; expires=' + expires.toUTCString() + '; path=/';
return null;

@@ -495,0 +496,0 @@ });

{
"name": "kinvey-html5-sdk",
"version": "3.9.0-beta.2",
"version": "3.9.0",
"description": "Kinvey JavaScript SDK for HTML5 applications.",

@@ -44,3 +44,3 @@ "homepage": "http://www.kinvey.com",

"es6-promise": "4.1.0",
"kinvey-js-sdk": "3.9.0-beta.2",
"kinvey-js-sdk": "3.9.0",
"local-storage-fallback": "4.0.0",

@@ -52,3 +52,3 @@ "lodash": "4.17.4",

"peerDependencies": {
"kinvey-js-sdk": "3.9.0-beta.2"
"kinvey-js-sdk": "3.9.0"
},

@@ -66,2 +66,4 @@ "devDependencies": {

"browserstack-local": "^1.2.0",
"chai": "3.5.0",
"chai-as-promised": "6.0.0",
"eslint": "3.17.1",

@@ -68,0 +70,0 @@ "eslint-config-airbnb-base": "11.1.1",

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