New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kitsu

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kitsu - npm Package Compare versions

Comparing version 9.1.17 to 9.1.18

23

CHANGELOG.md

@@ -6,2 +6,25 @@ # Change Log

## [9.1.18](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.17...v9.1.18) (2021-01-06)
### Build System / Dependencies
* ignore 10.x dist output in 9.x releases ([56e455a](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/56e455a))
* update dependency axios to ^0.21.1 ([fcef128](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/fcef128))
### Chores
* **release:** update documentation ([24985f1](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/24985f1))
### Documentation Changes
* update minimum browser support for compiled outputs ([7cb4513](https://github.com/wopian/kitsu/tree/master/packages/kitsu/commit/7cb4513))
## [9.1.17](https://github.com/wopian/kitsu/tree/master/packages/kitsu/compare/v9.1.16...v9.1.17) (2020-12-06)

@@ -8,0 +31,0 @@

2

lib/index.js

@@ -1,1 +0,1 @@

"use strict";var e=require("axios"),s=require("pluralize"),a=require("kitsu-core");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e),i=t(s);module.exports=class{constructor(e={}){!1===e.camelCaseTypes?this.camel=e=>e:this.camel=a.camel,"none"===e.resourceCase?this.resCase=e=>e:"snake"===e.resourceCase?this.resCase=a.snake:this.resCase=a.kebab,!1===e.pluralize?this.plural=e=>e:this.plural=i.default,this.headers=Object.assign({},e.headers,{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"}),this.axios=r.default.create(Object.assign({},{baseURL:e.baseURL||"https://kitsu.io/api/edge",timeout:e.timeout||3e4},e.axiosOptions)),this.fetch=this.get,this.update=this.patch,this.create=this.post,this.remove=this.delete,this.interceptors=this.axios.interceptors}async get(e,s={},t={}){try{const[r,i,l]=e.split("/");let c=this.plural(this.resCase(r));i&&(c+="/".concat(i)),l&&(c+="/".concat(this.resCase(l)));const{data:h}=await this.axios.get(c,{params:s,paramsSerializer:e=>a.query(e),headers:Object.assign(this.headers,t)});return a.deserialise(h)}catch(e){throw a.error(e)}}async patch(e,s,t={}){try{const[r,i]=a.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),l=a.serialise(r,s,"PATCH",{camelCaseTypes:this.camel,pluralTypes:this.plural}),c=null!=s&&s.id?"".concat(i,"/").concat(s.id):i,{data:h}=await this.axios.patch(c,l,{headers:Object.assign(this.headers,t)});return a.deserialise(h)}catch(e){throw a.error(e)}}async post(e,s,t={}){try{const[r,i]=a.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),{data:l}=await this.axios.post(i,a.serialise(r,s,"POST",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{headers:Object.assign(this.headers,t)});return a.deserialise(l)}catch(e){throw a.error(e)}}async delete(e,s,t={}){try{const[r,i]=a.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural});let l,c;Array.isArray(s)?(l=i,c=s.map((e=>({id:e})))):(l="".concat(i,"/").concat(s),c={id:s});const{data:h}=await this.axios.delete(l,{data:a.serialise(r,c,"DELETE",{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:Object.assign(this.headers,t)});return h}catch(e){throw a.error(e)}}async self(e={},s={}){try{return(await this.get("users",Object.assign({filter:{self:!0}},e),s)).data[0]}catch(e){throw a.error(e)}}async request({body:e,method:s,params:t,type:r,url:i},l={}){try{var c;s=(null===(c=s)||void 0===c?void 0:c.toUpperCase())||"GET";const{data:h}=await this.axios.request({method:s,url:i,data:["GET","DELETE"].includes(s)?void 0:a.serialise(r,e,s,{camelCaseTypes:this.camel,pluralTypes:this.plural}),params:t,paramsSerializer:e=>a.query(e),headers:Object.assign(this.headers,l)});return a.deserialise(h)}catch(e){throw a.error(e)}}};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var s=e(require("axios")),a=e(require("pluralize")),t=require("kitsu-core");module.exports=class{constructor(e={}){!1===e.camelCaseTypes?this.camel=e=>e:this.camel=t.camel,"none"===e.resourceCase?this.resCase=e=>e:"snake"===e.resourceCase?this.resCase=t.snake:this.resCase=t.kebab,!1===e.pluralize?this.plural=e=>e:this.plural=a,this.headers=Object.assign({},e.headers,{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"}),this.axios=s.create(Object.assign({},{baseURL:e.baseURL||"https://kitsu.io/api/edge",timeout:e.timeout||3e4},e.axiosOptions)),this.fetch=this.get,this.update=this.patch,this.create=this.post,this.remove=this.delete,this.interceptors=this.axios.interceptors}async get(e,s={},a={}){try{const[r,i,l]=e.split("/");let c=this.plural(this.resCase(r));i&&(c+="/".concat(i)),l&&(c+="/".concat(this.resCase(l)));const{data:h}=await this.axios.get(c,{params:s,paramsSerializer:e=>t.query(e),headers:Object.assign(this.headers,a)});return t.deserialise(h)}catch(e){throw t.error(e)}}async patch(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),l=t.serialise(r,s,"PATCH",{camelCaseTypes:this.camel,pluralTypes:this.plural}),c=null!=s&&s.id?"".concat(i,"/").concat(s.id):i,{data:h}=await this.axios.patch(c,l,{headers:Object.assign(this.headers,a)});return t.deserialise(h)}catch(e){throw t.error(e)}}async post(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural}),{data:l}=await this.axios.post(i,t.serialise(r,s,"POST",{camelCaseTypes:this.camel,pluralTypes:this.plural}),{headers:Object.assign(this.headers,a)});return t.deserialise(l)}catch(e){throw t.error(e)}}async delete(e,s,a={}){try{const[r,i]=t.splitModel(e,{resourceCase:this.resCase,pluralModel:this.plural});let l,c;Array.isArray(s)?(l=i,c=s.map(e=>({id:e}))):(l="".concat(i,"/").concat(s),c={id:s});const{data:h}=await this.axios.delete(l,{data:t.serialise(r,c,"DELETE",{camelCaseTypes:this.camel,pluralTypes:this.plural}),headers:Object.assign(this.headers,a)});return h}catch(e){throw t.error(e)}}async self(e={},s={}){try{return(await this.get("users",Object.assign({filter:{self:!0}},e),s)).data[0]}catch(e){throw t.error(e)}}async request({body:e,method:s,params:a,type:r,url:i},l={}){try{var c;s=(null===(c=s)||void 0===c?void 0:c.toUpperCase())||"GET";const{data:h}=await this.axios.request({method:s,url:i,data:["GET","DELETE"].includes(s)?void 0:t.serialise(r,e,s,{camelCaseTypes:this.camel,pluralTypes:this.plural}),params:a,paramsSerializer:e=>t.query(e),headers:Object.assign(this.headers,l)});return t.deserialise(h)}catch(e){throw t.error(e)}}};
{
"version": "9.1.17",
"version": "9.1.18",
"name": "kitsu",

@@ -50,4 +50,4 @@ "description": "A simple, lightweight & framework agnostic JSON:API client using Axios",

"dependencies": {
"axios": "^0.21.0",
"kitsu-core": "^9.1.17",
"axios": "^0.21.1",
"kitsu-core": "^9.1.18",
"pluralize": "^8.0.0"

@@ -67,3 +67,3 @@ },

],
"gitHead": "c7d71b9c910c608de00fa2241ff8a15ff49ad26e",
"gitHead": "7d88dbff7802d7f54c8dfa541adb6251016e96f2",
"devDependencies": {

@@ -70,0 +70,0 @@ "@size-limit/preset-small-lib": "~4.5.0"

@@ -40,3 +40,3 @@ <h1 align=center>Kitsu</h1>

| ------: | :----------------: | :--: | :----: | :-----: | :----: | :--: |
| `kitsu` | ≤ 8.2 kb | 10+ | 69+ | 68+ | 12+ | 18+ |
| `kitsu` | ≤ 8.2 kb | 10+ | 72+ | 78+ | 12.1+ | 86+ |

@@ -213,3 +213,3 @@ \* Including all dependencies & minified with brotli

[packages/kitsu/src/index.js:30-473](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L30-L473 "Source code on GitHub")
[packages/kitsu/src/index.js:30-473](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L30-L473 "Source code on GitHub")

@@ -261,3 +261,3 @@ Creates a new `kitsu` instance

[packages/kitsu/src/index.js:52-53](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L52-L53 "Source code on GitHub")
[packages/kitsu/src/index.js:52-53](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L52-L53 "Source code on GitHub")

@@ -284,3 +284,3 @@ - **See: <https://www.npmjs.com/package/pluralize> for documentation

[packages/kitsu/src/index.js:67-67](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L67-L67 "Source code on GitHub")
[packages/kitsu/src/index.js:67-67](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L67-L67 "Source code on GitHub")

@@ -316,3 +316,3 @@ Get the current headers or add additional headers

[packages/kitsu/src/index.js:112-112](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L112-L112 "Source code on GitHub")
[packages/kitsu/src/index.js:112-112](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L112-L112 "Source code on GitHub")

@@ -368,3 +368,3 @@ - **See: <https://github.com/axios/axios#interceptors> for documentation

[packages/kitsu/src/index.js:198-217](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L198-L217 "Source code on GitHub")
[packages/kitsu/src/index.js:198-217](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L198-L217 "Source code on GitHub")

@@ -499,3 +499,3 @@ Fetch resources (alias `fetch`)

[packages/kitsu/src/index.js:250-271](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L250-L271 "Source code on GitHub")
[packages/kitsu/src/index.js:250-271](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L250-L271 "Source code on GitHub")

@@ -563,3 +563,3 @@ Update a resource (alias `update`)

[packages/kitsu/src/index.js:299-318](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L299-L318 "Source code on GitHub")
[packages/kitsu/src/index.js:299-318](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L299-L318 "Source code on GitHub")

@@ -607,3 +607,3 @@ Create a new resource (alias `create`)

[packages/kitsu/src/index.js:333-362](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L333-L362 "Source code on GitHub")
[packages/kitsu/src/index.js:333-362](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L333-L362 "Source code on GitHub")

@@ -638,3 +638,3 @@ Remove a resource (alias `remove`)

[packages/kitsu/src/index.js:384-391](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L384-L391 "Source code on GitHub")
[packages/kitsu/src/index.js:384-391](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L384-L391 "Source code on GitHub")

@@ -676,3 +676,3 @@ Get the authenticated user's data

[packages/kitsu/src/index.js:452-472](https://github.com/wopian/kitsu/blob/d733c6351273481aa9207366784e3c8748681fa3/packages/kitsu/src/index.js#L452-L472 "Source code on GitHub")
[packages/kitsu/src/index.js:452-472](https://github.com/wopian/kitsu/blob/7cb4513bb9c711ba6e1d06bba9fabca0afe15390/packages/kitsu/src/index.js#L452-L472 "Source code on GitHub")

@@ -679,0 +679,0 @@ Send arbitrary requests

Sorry, the diff of this file is not supported yet

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