Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yldmag/sdk-local

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yldmag/sdk-local - npm Package Compare versions

Comparing version 1.0.7-alpha.10-beta to 1.0.7-alpha.11-beta

4

build/bundle.js
/**
*
* @yldmag/sdk-local with version 1.0.7-alpha.10-beta
* @yldmag/sdk-local with version 1.0.7-alpha.11-beta
* @author elaineeeit@gmail.com

@@ -10,2 +10,2 @@ * @copyright 2020-2021

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).TestPurrKittens=e()}(this,function(){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,r,n;e=o,n=i[r=t],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function p(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=require("node-fetch");module.exports=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)},t.fetch||(t.fetch=module.exports,t.Response=r.Response,t.Headers=r.Headers,t.Request=r.Request);function l(){u(this,l);var t=!0,e=!1,r=void 0;try{for(var n,o=Object.getOwnPropertyNames(this.constructor.prototype)[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){var i=n.value,s=this[i];"constructor"!==i&&"function"==typeof s&&(this[i]=s.bind(this))}}catch(t){e=!0,r=t}finally{try{t||null==o.return||o.return()}finally{if(e)throw r}}}var y=!("undefined"!=typeof window&&window.document&&window.document.createElement),n=["string","undefined","boolean","number","object","null","function","array"];function h(t,e){if("string"!=typeof e)throw new TypeError("expectedType argument must be string, but got ".concat(o(e)));if(-1===n.indexOf(e))throw new TypeError("expectedTypeArgument must be one of these types : ".concat(n.join(",")));switch(e){case"null":return null===t;case"array":return Array.isArray(t);case"object":return null!==t&&o(t)===e;default:return o(t)===e}}var b=c({},{getAllPosts:function(t){var e=0<arguments.length&&void 0!==t?t:{},r=e.page,n=e.limit;return r&&this.checkArgumentType(r,"page","number"),n&&this.checkArgumentType(n,"limit","number"),this.get("/posts",{params:{scope:"all",page:r,limit:n}})},getPost:function(t){return this.checkArgumentType(t,"url","string"),this.get("/post/".concat(t))}},{},{getCategories:function(t){var e=(0<arguments.length&&void 0!==t?t:{}).scope,r=void 0===e?"all":e;return this.checkArgumentType(r,"scope","string"),this.get("/categories",{params:{scope:r}})}},{},{getAuthors:function(){return this.get("/authors")},getAuthorById:function(t){return this.get("/authors/".concat(t))},getAuthorPosts:function(t,e){var r=(1<arguments.length&&void 0!==e?e:{}).sort,n={sort:void 0!==r&&r||"asc"};return this.get("/authors/".concat(t,"/posts"),{params:n})}},{},{getReactionsByURL:function(t){return this.checkArgumentType(t,"url","string"),this.get("/posts/".concat(t,"/reactions"))}}),g=function(){function r(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(u(this,r),t=p(this,s(r).call(this)),!Object.prototype.hasOwnProperty.call(e,"baseURL"))throw new TypeError("baseURL argument is required");if(!h(e.baseURL,"string"))throw new TypeError("baseURL argument must be string but got ".concat(o(e.baseURL)));if(!e.baseURL.startsWith("http")&&!e.baseURL.startsWith("https"))throw new Error("baseURL argument must be start with http or https prefix but got ".concat(e.baseURL));return t.baseURL=e.baseURL.concat("/"),t}var t,e,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(r,l),t=r,(e=[{key:"checkArgumentType",value:function(e,t,r){if(Array.isArray(r)){if(!r.some(function(t){return h(e,t)}))throw new TypeError("Argument ".concat(t," must be at least one of these types : ").concat(r.join("or")," but got ").concat(o(e)," "))}else if(!h(e,r))throw new TypeError("Argument ".concat(t," must be ").concat(r," but got ").concat(o(e)))}},{key:"request",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=this.baseURL.concat(t),n=new Headers(e.headers||{});y&&n.set("Is-server",!0),"POST"!==e.method&&"UPDATE"!==e.method&&"PATCH"!==e.method||(e.body=JSON.stringify(e.body)||{},n.set("Content-Type","application/json"));var o=new Request(r,c({},e,{headers:n}));return fetch(o).then(function(t){if(300<=t.status||t.status<200)throw new Error(t.statusText);return t.json().then(function(t){return t})})}},{key:"get",value:function(t,e){var r,n=1<arguments.length&&void 0!==e?e:{},o=n.params,i=void 0===o?{}:o,s=f(n,["params"]),u=0<Object.keys(i).length?t.concat("?",(r=i,Object.entries(r).map(function(t){return t[0].concat("=",t[1])}).join("&"))):t;return this.request(u,c({method:"GET"},s))}},{key:"post",value:function(t,e){var r=1<arguments.length&&void 0!==e?e:{};return this.request(t,c({method:"POST",body:JSON.stringify(r.body)},r))}},{key:"patch",value:function(t,e){var r=1<arguments.length&&void 0!==e?e:{};return this.request(t,{method:"PATCH",params:r})}}])&&i(t.prototype,e),n&&i(t,n),r}();return Object.keys(b).forEach(function(t){g.prototype[t]=b[t]}),g});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).TestPurrKittens=e()}(this,function(){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,r,n;e=o,n=i[r=t],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function p(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=require("node-fetch");module.exports=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)},t.fetch||(t.fetch=module.exports,t.Response=r.Response,t.Headers=r.Headers,t.Request=r.Request);function l(){c(this,l);var t=!0,e=!1,r=void 0;try{for(var n,o=Object.getOwnPropertyNames(this.constructor.prototype)[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){var i=n.value,s=this[i];"constructor"!==i&&"function"==typeof s&&(this[i]=s.bind(this))}}catch(t){e=!0,r=t}finally{try{t||null==o.return||o.return()}finally{if(e)throw r}}}var y=!("undefined"!=typeof window&&window.document&&window.document.createElement),n=["string","undefined","boolean","number","object","null","function","array"];function h(t,e){if("string"!=typeof e)throw new TypeError("expectedType argument must be string, but got ".concat(o(e)));if(-1===n.indexOf(e))throw new TypeError("expectedTypeArgument must be one of these types : ".concat(n.join(",")));switch(e){case"null":return null===t;case"array":return Array.isArray(t);case"object":return null!==t&&o(t)===e;default:return o(t)===e}}var g=u({},{getAllPosts:function(t){var e=0<arguments.length&&void 0!==t?t:{},r=e.page,n=e.limit;return r&&this.checkArgumentType(r,"page","number"),n&&this.checkArgumentType(n,"limit","number"),this.get("/posts",{params:{scope:"all",page:r,limit:n}})},getPost:function(t){return this.checkArgumentType(t,"url","string"),this.get("/post/".concat(t))},getPostByCategory:function(t,e){var r=1<arguments.length&&void 0!==e?e:{},n=r.scope,o=void 0===n?"summary":n,i=r.page,s=void 0===i?1:i,c=r.limit,u=void 0===c?10:c;return this.checkArgumentType(t,"categoryURL","string"),this.checkArgumentType(o,"limit","string"),this.checkArgumentType(s,"page",["number","string"]),this.checkArgumentType(u,"limit",["number","string"]),this.get("/categories/".concat(t,"/posts"),{params:{scope:o,page:s,limit:u}})}},{},{getCategories:function(t){var e=(0<arguments.length&&void 0!==t?t:{}).scope,r=void 0===e?"all":e;return this.checkArgumentType(r,"scope","string"),this.get("/categories",{params:{scope:r}})}},{},{getAuthors:function(){return this.get("/authors")},getAuthorById:function(t){return this.get("/authors/".concat(t))},getAuthorPosts:function(t,e){var r=(1<arguments.length&&void 0!==e?e:{}).sort,n={sort:void 0!==r&&r||"asc"};return this.get("/authors/".concat(t,"/posts"),{params:n})}},{},{getReactionsByURL:function(t){return this.checkArgumentType(t,"url","string"),this.get("/posts/".concat(t,"/reactions"))}}),b=function(){function r(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(c(this,r),t=p(this,s(r).call(this)),!Object.prototype.hasOwnProperty.call(e,"baseURL"))throw new TypeError("baseURL argument is required");if(!h(e.baseURL,"string"))throw new TypeError("baseURL argument must be string but got ".concat(o(e.baseURL)));if(!e.baseURL.startsWith("http")&&!e.baseURL.startsWith("https"))throw new Error("baseURL argument must be start with http or https prefix but got ".concat(e.baseURL));return t.baseURL=e.baseURL.concat("/"),t}var t,e,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(r,l),t=r,(e=[{key:"checkArgumentType",value:function(e,t,r){if(Array.isArray(r)){if(!r.some(function(t){return h(e,t)}))throw new TypeError("Argument ".concat(t," must be at least one of these types : ").concat(r.join(" or ")," but got ").concat(o(e)," "))}else if(!h(e,r))throw new TypeError("Argument ".concat(t," must be ").concat(r," but got ").concat(o(e)))}},{key:"request",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=this.baseURL.concat(t),n=new Headers(e.headers||{});y&&n.set("Is-server",!0),"POST"!==e.method&&"UPDATE"!==e.method&&"PATCH"!==e.method||(e.body=JSON.stringify(e.body)||{},n.set("Content-Type","application/json"));var o=new Request(r,u({},e,{headers:n}));return fetch(o).then(function(t){if(300<=t.status||t.status<200)throw new Error(t.statusText);return t.json().then(function(t){return t})})}},{key:"get",value:function(t,e){var r,n=1<arguments.length&&void 0!==e?e:{},o=n.params,i=void 0===o?{}:o,s=f(n,["params"]),c=0<Object.keys(i).length?t.concat("?",(r=i,Object.entries(r).map(function(t){return t[0].concat("=",t[1])}).join("&"))):t;return this.request(c,u({method:"GET"},s))}},{key:"post",value:function(t,e){var r=1<arguments.length&&void 0!==e?e:{};return this.request(t,u({method:"POST",body:JSON.stringify(r.body)},r))}},{key:"patch",value:function(t,e){var r=1<arguments.length&&void 0!==e?e:{};return this.request(t,{method:"PATCH",params:r})}}])&&i(t.prototype,e),n&&i(t,n),r}();return Object.keys(g).forEach(function(t){b.prototype[t]=g[t]}),b});
{
"name": "@yldmag/sdk-local",
"version": "1.0.7-alpha.10-beta",
"version": "1.0.7-alpha.11-beta",
"main": "build/bundle.js",

@@ -5,0 +5,0 @@ "author": "elaineeeit@gmail.com",

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