apps-script-db
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -16,3 +16,3 @@ 'use strict'; | ||
AppsScriptDB.prototype._stringify = function _stringify (data) { | ||
return Object.keys(data).map(function (k) { return (k + "=" + (data[k])); }).join('&'); | ||
return Object.keys(data).map(function (k) { return (k + "=" + (encodeURIComponent(data[k]))); }).join('&'); | ||
}; | ||
@@ -19,0 +19,0 @@ AppsScriptDB.prototype._GET = function _GET (url, data) { |
@@ -14,3 +14,3 @@ var AppsScriptDB = function AppsScriptDB(url, fetch) { | ||
AppsScriptDB.prototype._stringify = function _stringify (data) { | ||
return Object.keys(data).map(function (k) { return (k + "=" + (data[k])); }).join('&'); | ||
return Object.keys(data).map(function (k) { return (k + "=" + (encodeURIComponent(data[k]))); }).join('&'); | ||
}; | ||
@@ -17,0 +17,0 @@ AppsScriptDB.prototype._GET = function _GET (url, data) { |
@@ -20,3 +20,3 @@ (function (global, factory) { | ||
AppsScriptDB.prototype._stringify = function _stringify (data) { | ||
return Object.keys(data).map(function (k) { return (k + "=" + (data[k])); }).join('&'); | ||
return Object.keys(data).map(function (k) { return (k + "=" + (encodeURIComponent(data[k]))); }).join('&'); | ||
}; | ||
@@ -23,0 +23,0 @@ AppsScriptDB.prototype._GET = function _GET (url, data) { |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ADB=e()}(this,function(){"use strict";var t=function(t,e){if(void 0===e&&(e=window.fetch.bind(window)),"string"!=typeof t||"function"!=typeof e)throw new TypeError("url should be string,fetch should be whatwg-fetch.");this.url=t,this.fetch=e};return t.prototype.handleResult=function(t){return function(e){if("error"===e)throw new Error("Failed to "+t)}},t.prototype._stringify=function(t){return Object.keys(t).map(function(e){return e+"="+t[e]}).join("&")},t.prototype._GET=function(t,e){return this.fetch(t+"?"+this._stringify(e)).then(function(t){return t.text()})},t.prototype._POST=function(t,e){return this.fetch(t,{method:"POST",body:this._stringify(e),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(t){return t.text()})},t.prototype.get=function(t){if(void 0===t&&(t="*"),"string"!=typeof t)throw new TypeError("key should be string.");return this._GET(this.url,{key:t})},t.prototype.set=function(t,e){if("string"!=typeof t||"string"!=typeof e)throw new TypeError("key,value should be string.");return this._POST(this.url,{key:t,value:e}).then(this.handleResult("set"))},t.prototype.del=function(t){if(void 0===t&&(t="*"),"string"!=typeof t)throw new TypeError("key should be string.");return this._POST(this.url,{del:t}).then(this.handleResult("del"))},t}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ADB=e()}(this,function(){"use strict";var t=function(t,e){if(void 0===e&&(e=window.fetch.bind(window)),"string"!=typeof t||"function"!=typeof e)throw new TypeError("url should be string,fetch should be whatwg-fetch.");this.url=t,this.fetch=e};return t.prototype.handleResult=function(t){return function(e){if("error"===e)throw new Error("Failed to "+t)}},t.prototype._stringify=function(t){return Object.keys(t).map(function(e){return e+"="+encodeURIComponent(t[e])}).join("&")},t.prototype._GET=function(t,e){return this.fetch(t+"?"+this._stringify(e)).then(function(t){return t.text()})},t.prototype._POST=function(t,e){return this.fetch(t,{method:"POST",body:this._stringify(e),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(t){return t.text()})},t.prototype.get=function(t){if(void 0===t&&(t="*"),"string"!=typeof t)throw new TypeError("key should be string.");return this._GET(this.url,{key:t})},t.prototype.set=function(t,e){if("string"!=typeof t||"string"!=typeof e)throw new TypeError("key,value should be string.");return this._POST(this.url,{key:t,value:e}).then(this.handleResult("set"))},t.prototype.del=function(t){if(void 0===t&&(t="*"),"string"!=typeof t)throw new TypeError("key should be string.");return this._POST(this.url,{del:t}).then(this.handleResult("del"))},t}); | ||
//# sourceMappingURL=apps-script-db.min.js.map |
{ | ||
"name": "apps-script-db", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"main": "dist/apps-script-db.cjs.js", | ||
@@ -5,0 +5,0 @@ "browser": "dist/apps-script-db.min.js", |
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
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
121096
11
220
13