@browser-storage/websql-driver
Advanced tools
Comparing version 0.0.1-alpha.10 to 0.0.1-alpha.11
@@ -1,1 +0,1 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(u,s)}c((r=r.apply(t,e||[])).next())})},i=function(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=function(){function t(){}return t.prototype.deserialize=function(t){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,JSON.parse(t)]})})},t.prototype.serialize=function(t){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,JSON.stringify(t)]})})},t}(),u=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(u,s)}c((r=r.apply(t,e||[])).next())})},s=function(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},c=function(){function t(t){var e=t.description,n=t.size,r=this;this._serializer=new o,this.description=e,this.size=n,this._ready={},this._ready.promise=new Promise(function(t,e){r._ready.resolve=t,r._ready.reject=e})}return Object.defineProperty(t.prototype,"isSupported",{get:function(){return"function"==typeof window.openDatabase},enumerable:!0,configurable:!0}),t.prototype.clear=function(){return u(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this._executeSql("DELETE FROM "+this.options.storeName)];case 1:return t.sent(),[2]}})})},t.prototype.destroy=function(){},t.prototype.getItem=function(t){return u(this,void 0,void 0,function(){var e;return s(this,function(n){switch(n.label){case 0:return[4,this._executeSql("SELECT * FROM "+this.options.storeName+" WHERE key = ? LIMIT 1",[t])];case 1:return e=n.sent(),[2,this._serializer.deserialize(e.rows.item(0).value)]}})})},t.prototype.hasItem=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,this.keys()];case 1:return[2,e.sent().indexOf(t)>-1]}})})},t.prototype.init=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return this.options=t,this.db=this._createDB(),[4,this._executeSql("CREATE TABLE IF NOT EXISTS "+this.options.storeName+" (id INTEGER PRIMARY KEY, key unique, value)")];case 1:return e.sent(),this._ready.resolve(!0),[2]}})})},t.prototype.iterate=function(t){return u(this,void 0,void 0,function(){var e=this;return s(this,function(n){switch(n.label){case 0:return[4,this.keys()];case 1:return[2,n.sent().reduceRight(function(n,r,i){return u(e,void 0,void 0,function(){var e;return s(this,function(o){switch(o.label){case 0:return[4,n];case 1:return o.sent(),[4,this.getItem(r)];case 2:return e=o.sent(),[4,t(r,e,i)];case 3:return o.sent(),[2]}})})},Promise.resolve())]}})})},t.prototype.key=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,this.keys()];case 1:return[2,e.sent()[t]]}})})},t.prototype.keys=function(){return u(this,void 0,void 0,function(){var t,e,n;return s(this,function(r){switch(r.label){case 0:return[4,this._executeSql("SELECT key FROM "+this.options.storeName+" as a order by id")];case 1:for(t=r.sent(),e=[],n=0;n<t.rows.length;n++)e.push(t.rows.item(n).key);return[2,e]}})})},t.prototype.length=function(){return u(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this._executeSql("SELECT COUNT(key) as count FROM "+this.options.storeName)];case 1:return[2,t.sent().rows.item(0).count]}})})},t.prototype.ready=function(){return this._ready.promise},t.prototype.removeItem=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,this._executeSql("DELETE FROM "+this.options.storeName+" WHERE key = ?",[t])];case 1:return e.sent(),[2]}})})},t.prototype.setItem=function(t,e){return u(this,void 0,void 0,function(){var n,r,i;return s(this,function(o){switch(o.label){case 0:return n=this._executeSql,r=["INSERT OR REPLACE INTO "+this.options.storeName+" (key, value) VALUES (?, ?)"],i=[t],[4,this._serializer.serialize(e)];case 1:return[4,n.apply(this,r.concat([i.concat([o.sent()])]))];case 2:return o.sent(),[2,e]}})})},t.prototype._transaction=function(){return u(this,void 0,void 0,function(){var t=this;return s(this,function(e){return[2,new Promise(function(e,n){t.db.transaction(function(t){e(t)},n)})]})})},t.prototype._executeSql=function(t,e){return void 0===e&&(e=[]),u(this,void 0,void 0,function(){var n;return s(this,function(r){switch(r.label){case 0:return[4,this._transaction()];case 1:return n=r.sent(),[2,new Promise(function(r,i){n.executeSql(t,e,function(t,e){return r(e)},function(t,e){return i(e),!0})})]}})})},t.prototype._createDB=function(){return window.openDatabase(this.options.name,this.options.version.toString(),this.description,this.size)},t}();n.d(e,"WebsqlDriver",function(){return c}),n.d(e,"WebsqlSerializer",function(){return o})}])}); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(u,s)}c((r=r.apply(t,e||[])).next())})},i=function(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=function(){function t(){}return t.prototype.deserialize=function(t){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,JSON.parse(t)]})})},t.prototype.serialize=function(t){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,JSON.stringify(t)]})})},t}(),u=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(u,s)}c((r=r.apply(t,e||[])).next())})},s=function(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},c=function(){function t(t){var e=t.description,n=t.size,r=this;this._serializer=new o,this.description=e,this.size=n,this._ready={},this._ready.promise=new Promise(function(t,e){r._ready.resolve=t,r._ready.reject=e})}return Object.defineProperty(t.prototype,"isSupported",{get:function(){return"function"==typeof window.openDatabase},enumerable:!0,configurable:!0}),t.prototype.clear=function(){return u(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this._executeSql("DELETE FROM "+this.options.storeName)];case 1:return t.sent(),[2]}})})},t.prototype.destroy=function(){},t.prototype.getItem=function(t){return u(this,void 0,void 0,function(){var e;return s(this,function(n){switch(n.label){case 0:return[4,this._executeSql("SELECT * FROM "+this.options.storeName+" WHERE key = ? LIMIT 1",[t])];case 1:return[2,(e=n.sent()).rows.item.length&&this._serializer.deserialize(e.rows.item(0).value)]}})})},t.prototype.hasItem=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,this.keys()];case 1:return[2,e.sent().indexOf(t)>-1]}})})},t.prototype.init=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return this.options=t,this.db=this._createDB(),[4,this._executeSql("CREATE TABLE IF NOT EXISTS "+this.options.storeName+" (id INTEGER PRIMARY KEY, key unique, value)")];case 1:return e.sent(),this._ready.resolve(!0),[2]}})})},t.prototype.iterate=function(t){return u(this,void 0,void 0,function(){var e=this;return s(this,function(n){switch(n.label){case 0:return[4,this.keys()];case 1:return[2,n.sent().reduceRight(function(n,r,i){return u(e,void 0,void 0,function(){var e;return s(this,function(o){switch(o.label){case 0:return[4,n];case 1:return o.sent(),[4,this.getItem(r)];case 2:return e=o.sent(),[4,t(r,e,i)];case 3:return o.sent(),[2]}})})},Promise.resolve())]}})})},t.prototype.key=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,this.keys()];case 1:return[2,e.sent()[t]]}})})},t.prototype.keys=function(){return u(this,void 0,void 0,function(){var t,e,n;return s(this,function(r){switch(r.label){case 0:return[4,this._executeSql("SELECT key FROM "+this.options.storeName+" as a order by id")];case 1:for(t=r.sent(),e=[],n=0;n<t.rows.length;n++)e.push(t.rows.item(n).key);return[2,e]}})})},t.prototype.length=function(){return u(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this._executeSql("SELECT COUNT(key) as count FROM "+this.options.storeName)];case 1:return[2,t.sent().rows.item(0).count]}})})},t.prototype.ready=function(){return this._ready.promise},t.prototype.removeItem=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,this._executeSql("DELETE FROM "+this.options.storeName+" WHERE key = ?",[t])];case 1:return e.sent(),[2]}})})},t.prototype.setItem=function(t,e){return u(this,void 0,void 0,function(){var n,r,i;return s(this,function(o){switch(o.label){case 0:return n=this._executeSql,r=["INSERT OR REPLACE INTO "+this.options.storeName+" (key, value) VALUES (?, ?)"],i=[t],[4,this._serializer.serialize(e)];case 1:return[4,n.apply(this,r.concat([i.concat([o.sent()])]))];case 2:return o.sent(),[2,e]}})})},t.prototype._transaction=function(){return u(this,void 0,void 0,function(){var t=this;return s(this,function(e){return[2,new Promise(function(e,n){t.db.transaction(function(t){e(t)},n)})]})})},t.prototype._executeSql=function(t,e){return void 0===e&&(e=[]),u(this,void 0,void 0,function(){var n;return s(this,function(r){switch(r.label){case 0:return[4,this._transaction()];case 1:return n=r.sent(),[2,new Promise(function(r,i){n.executeSql(t,e,function(t,e){return r(e)},function(t,e){return i(e),!0})})]}})})},t.prototype._createDB=function(){return window.openDatabase(this.options.name,this.options.version.toString(),this.description,this.size)},t}();n.d(e,"WebsqlDriver",function(){return c}),n.d(e,"WebsqlSerializer",function(){return o})}])}); |
{ | ||
"name": "@browser-storage/websql-driver", | ||
"version": "0.0.1-alpha.10", | ||
"version": "0.0.1-alpha.11", | ||
"description": "Web SQL driver for BrowserStorage", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@browser-storage/core": "^0.0.1-alpha.10" | ||
"@browser-storage/core": "^0.0.1-alpha.11" | ||
}, | ||
@@ -41,3 +41,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "9461ffba2616bc1d40b9ea1d9ee2d10362495502" | ||
"gitHead": "e58edc04f093284802eafa84363578db9bf7e042" | ||
} |
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
10882
0