kinvey-html5-sdk
Advanced tools
Comparing version 3.9.0-beta.2 to 3.9.0
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
360664
29
8158
0
30
1
+ Addedbuffer@5.0.7(transitive)
+ Addedes6-promise@4.1.1(transitive)
+ Addedkinvey-js-sdk@3.9.0(transitive)
+ Addedloglevel@1.5.0(transitive)
+ Addedpubnub@4.15.1(transitive)
+ Addedqs@6.5.1(transitive)
+ Addedrxjs@5.4.3(transitive)
+ Addeduid-safe@2.1.5(transitive)
+ Addeduuid@3.1.0(transitive)
- Removedbuffer@5.0.6(transitive)
- Removedkinvey-js-sdk@3.9.0-beta.2(transitive)
- Removedloglevel@1.4.1(transitive)
- Removedpubnub@4.8.0(transitive)
- Removedqs@6.4.0(transitive)
- Removedrxjs@5.4.0(transitive)
- Removeduid-safe@2.1.4(transitive)
- Removeduuid@3.0.1(transitive)
Updatedkinvey-js-sdk@3.9.0