Comparing version 1.0.1 to 1.0.2
@@ -7,11 +7,19 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var Interface = function () { | ||
function Interface(name) { | ||
_classCallCheck(this, Interface); | ||
(0, _classCallCheck3.default)(this, Interface); | ||
@@ -22,3 +30,3 @@ this.__interface_name = name; | ||
_createClass(Interface, [{ | ||
(0, _createClass3.default)(Interface, [{ | ||
key: 'getItem', | ||
@@ -31,3 +39,3 @@ value: function getItem(key) { | ||
value: function setItem(key, value) { | ||
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { | ||
if ((typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object') { | ||
value = value.toString(); | ||
@@ -48,3 +56,2 @@ } | ||
}]); | ||
return Interface; | ||
@@ -51,0 +58,0 @@ }(); |
@@ -8,6 +8,18 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
var _getIterator2 = require('babel-runtime/core-js/get-iterator'); | ||
var _getIterator3 = _interopRequireDefault(_getIterator2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _objectAssign = require('object-assign'); | ||
@@ -23,4 +35,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var STORAGE_DRIVERS = ['MEMORY', 'LOCALSTORAGE', 'SESSIONSTORAGE', 'DOMAINSTORAGE']; | ||
@@ -46,3 +56,3 @@ | ||
try { | ||
for (var _iterator = STORAGE_DRIVERS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (var _iterator = (0, _getIterator3.default)(STORAGE_DRIVERS), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var driver = _step.value; | ||
@@ -56,3 +66,3 @@ | ||
case 'LOCALSTORAGE': | ||
if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.localStorage) { | ||
if ((typeof window === 'undefined' ? 'undefined' : (0, _typeof3.default)(window)) === 'object' && window.localStorage) { | ||
STORAGE_INTERFACE[driver] = window.localStorage; | ||
@@ -64,3 +74,3 @@ } else { | ||
case 'SESSIONSTORAGE': | ||
if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.sessionStorage) { | ||
if ((typeof window === 'undefined' ? 'undefined' : (0, _typeof3.default)(window)) === 'object' && window.sessionStorage) { | ||
STORAGE_INTERFACE[driver] = window.sessionStorage; | ||
@@ -111,5 +121,4 @@ } else { | ||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
(0, _classCallCheck3.default)(this, Storage); | ||
_classCallCheck(this, Storage); | ||
this.config = (0, _objectAssign2.default)(defaultConfig, options); | ||
@@ -121,3 +130,3 @@ // set storage interface | ||
_createClass(Storage, [{ | ||
(0, _createClass3.default)(Storage, [{ | ||
key: 'setItem', | ||
@@ -150,3 +159,2 @@ value: function setItem(key, value) { | ||
}]); | ||
return Storage; | ||
@@ -153,0 +161,0 @@ }(); |
{ | ||
"name": "a-storage", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Provide an easy way to use storage in browsers.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "babel src -d lib --source-maps --presets=es2015" | ||
"build": "babel src -d lib --source-maps --plugins=transform-runtime --presets=es2015" | ||
}, | ||
@@ -32,4 +32,5 @@ "repository": { | ||
"babel-loader": "^6.2.7", | ||
"babel-plugin-transform-runtime": "^6.15.0", | ||
"babel-preset-es2015": "^6.18.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
293
0
18042
5