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

kitsu-core

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kitsu-core - npm Package Compare versions

Comparing version 9.0.7 to 9.1.0

35

CHANGELOG.md

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

# [9.1.0](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/compare/v9.0.7...v9.1.0) (2020-05-21)
### Bug Fixes
* **kitsu-core:** resolve linkedRelationships regression introduced in 568eff5 ([66095cc](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/66095cc))
### Chores
* **release:** update documentation ([d77384c](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/d77384c))
* increase package warning limit ([c0136dc](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/c0136dc))
### Documentation Changes
* correct errors in types ([9ad8fc0](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/9ad8fc0))
* **kitsu-core:** add internal documentation for new private functions ([0d10ba3](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/0d10ba3))
* **kitsu-core:** update description of deserialise parameter ([94dc48a](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/94dc48a))
### New Features
* **kitsu-core:** support the bulk extension specification (serialise arrays) ([920ece3](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/920ece3)), closes [#336](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/issues/336)
### Refactors
* **kitsu-core:** cleanup linkRelationships + use optional chaining ([568eff5](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/568eff5))
* **kitsu-core:** use optional chaining in deserialise ([43d5d4b](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/43d5d4b))
## [9.0.7](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/compare/v9.0.6...v9.0.7) (2020-05-19)

@@ -8,0 +43,0 @@

2

lib/deserialise.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./deattribute.js");require("./error.js"),require("./filterIncludes.js");var e=require("./linkRelationships.js");exports.deserialise=function(a){if(a)return a.data&&a.data.constructor===Array?a=function(a){for(let i of a.data)a.included&&(i=e.linkRelationships(i,a.included)),i.relationships&&(i=e.linkRelationships(i)),i.attributes&&(i=t.deattribute(i)),a.data[a.data.indexOf(i)]=i;return a}(a):a.included?a.data=e.linkRelationships(a.data,a.included):a.data&&a.data.constructor===Object&&(a.data=e.linkRelationships(a.data)),delete a.included,a.data&&a.data.attributes&&(a.data=t.deattribute(a.data)),a};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./deattribute.js");require("./error.js"),require("./filterIncludes.js");var t=require("./linkRelationships.js");exports.deserialise=function(i){var a,r;if(i)return Array.isArray(i.data)?i=function(i){for(let a of i.data)i.included&&(a=t.linkRelationships(a,i.included)),a.relationships&&(a=t.linkRelationships(a)),a.attributes&&(a=e.deattribute(a)),i.data[i.data.indexOf(a)]=a;return i}(i):i.included?i.data=t.linkRelationships(i.data,i.included):(null===(a=i.data)||void 0===a?void 0:a.constructor)===Object&&(i.data=t.linkRelationships(i.data)),delete i.included,(null===(r=i.data)||void 0===r?void 0:r.attributes)&&(i.data=e.deattribute(i.data)),i};

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).kitsuCore={})}(this,(function(t){"use strict";function e(t){if("object"==typeof t&&null!==t)if(Array.isArray(t))t.map(t=>e(t));else if(t.attributes&&t.attributes.constructor===Object){for(const e of Object.keys(t.attributes))t.attributes.attributes||(t[e]=t.attributes[e]);t.attributes.attributes?t.attributes=t.attributes.attributes:delete t.attributes}return t}function r(t){if(t.response){const e=t.response.data;e&&e.errors&&(t.errors=e.errors)}throw t}function a(t,{id:e,type:a}){try{if(e&&a){const r=t.filter(t=>t.id===e&&t.type===a)[0]||{id:e,type:a};return Object.assign({},r)}return{}}catch(t){r(t)}}function n({id:t,type:r,meta:n,links:s},i){const o=a(i,{id:t,type:r});return o.relationships&&l(o,i),n&&(o.meta=n),e(o)}function s(t,e,r){t[r]={},t.relationships[r].links&&(t[r].links=t.relationships[r].links),t[r].data=[];for(const a of t.relationships[r].data)t[r].data.push(n(a,e));delete t.relationships[r]}function i(t,e,r){t[r]={},t[r].data=n(t.relationships[r].data,e),t.relationships[r].links&&(t[r].links=t.relationships[r].links),delete t.relationships[r]}function o(t,e,r){t[r]={},t.relationships[r].links&&(t[r].links=t.relationships[r].links),delete t.relationships[r]}function l(t,e=[]){const{relationships:r}=t;for(const a in r)r[a].data&&r[a].data.constructor===Array?s(t,e,a):r[a].data?i(t,e,a):o(t,0,a);return r&&0===Object.keys(r).length&&r.constructor===Object&&delete t.relationships,t}function u(t,e=null){const r=[];for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&r.push((a=t[s],n=e?"".concat(e,"[").concat(s,"]"):s,null!==a&&"object"==typeof a?u(a,n):encodeURIComponent(n)+"="+encodeURIComponent(a)));var a,n;return r.join("&")}function c(t,e,r,a,n){return a.relationships||(a.relationships={}),t.type||(t.type=e),a.relationships[r]={data:Object.assign(t)},a}function p(t,e,r,a,n){return a.relationships||(a.relationships={}),a.relationships[r]={data:t.map(({id:t,type:r})=>({id:t,type:r||e}))},a}function d(t,e,r){return r.attributes||(r.attributes={}),r.attributes[e]=t,r}function f(t){return Object.prototype.hasOwnProperty.call(t,"id")}t.camel=t=>t.replace(/[-_][a-z\u00E0-\u00F6\u00F8-\u00FE]/g,t=>t.slice(1).toUpperCase()),t.deattribute=e,t.deserialise=function(t){if(t)return t.data&&t.data.constructor===Array?t=function(t){for(let r of t.data)t.included&&(r=l(r,t.included)),r.relationships&&(r=l(r)),r.attributes&&(r=e(r)),t.data[t.data.indexOf(r)]=r;return t}(t):t.included?t.data=l(t.data,t.included):t.data&&t.data.constructor===Object&&(t.data=l(t.data)),delete t.included,t.data&&t.data.attributes&&(t.data=e(t.data)),t},t.error=r,t.filterIncludes=a,t.kebab=t=>t.charAt(0).toLowerCase()+t.slice(1).replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,t=>"-"+t.toLowerCase()),t.linkRelationships=l,t.query=u,t.serialise=function(t,e={},a="POST",n={}){try{if(n.camelCaseTypes||(n.camelCaseTypes=t=>t),n.pluralTypes||(n.pluralTypes=t=>t),null===e||Array.isArray(e)&&0===e.length)return{data:e};const r=n.pluralTypes(n.camelCaseTypes(t));let s={type:r};!function(t,e,r){if(t.constructor!==Object||0===Object.keys(t).length)throw new Error("".concat(e," requires a JSON object body"));if("POST"!==e&&!t.id)throw new Error("".concat(e," requires an ID for the ").concat(r," type"))}(e,a,r),e.id&&(s.id=String(e.id));for(const t in e){const r=e[t],a=n.pluralTypes(n.camelCaseTypes(t));null!==r&&r.constructor===Object&&f(r)?s=c(r,a,t,s):null!==r&&Array.isArray(r)&&r.length>0&&f(r[0])?s=p(r,a,t,s):"id"!==t&&"type"!==t&&(s=d(r,t,s))}return{data:s}}catch(t){throw r(t)}},t.snake=t=>t.charAt(0).toLowerCase()+t.slice(1).replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,t=>"_"+t.toLowerCase()),t.splitModel=function(t,e={}){e.pluralModel||(e.pluralModel=t=>t),e.resourceCase||(e.resourceCase=t=>t);const r=t.split("/"),a=r.pop();return r.push(e.pluralModel(e.resourceCase(a))),[a,r.join("/")]},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).kitsuCore={})}(this,(function(t){"use strict";function e(t){if("object"==typeof t&&null!==t)if(Array.isArray(t))t.map(t=>e(t));else if(t.attributes&&t.attributes.constructor===Object){for(const e of Object.keys(t.attributes))t.attributes.attributes||(t[e]=t.attributes[e]);t.attributes.attributes?t.attributes=t.attributes.attributes:delete t.attributes}return t}function r(t){if(t.response){const e=t.response.data;e&&e.errors&&(t.errors=e.errors)}throw t}function n(t,{id:e,type:n}){try{if(e&&n){const r=t.filter(t=>t.id===e&&t.type===n)[0]||{id:e,type:n};return Object.assign({},r)}return{}}catch(t){r(t)}}function i({id:t,type:r,meta:i},s){const a=n(s,{id:t,type:r});return a.relationships&&l(a,s),i&&(a.meta=i),e(a)}function s(t,e,r){t[r]={},t.relationships[r].links&&(t[r].links=t.relationships[r].links),t[r].data=[];for(const n of t.relationships[r].data)t[r].data.push(i(n,e));delete t.relationships[r]}function a(t,e,r){t[r]={},t[r].data=i(t.relationships[r].data,e),t.relationships[r].links&&(t[r].links=t.relationships[r].links),delete t.relationships[r]}function o(t,e){t[e]={},t.relationships[e].links&&(t[e].links=t.relationships[e].links),delete t.relationships[e]}function l(t,e=[]){const{relationships:r}=t;for(const i in r){var n;Array.isArray(null===(n=r[i])||void 0===n?void 0:n.data)?s(t,e,i):r[i].data?a(t,e,i):o(t,i)}return 0===Object.keys(r||[]).length&&(null==r?void 0:r.constructor)===Object&&delete t.relationships,t}function u(t,e=null){const r=[];for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&r.push((n=t[s],i=e?"".concat(e,"[").concat(s,"]"):s,null!==n&&"object"==typeof n?u(n,i):encodeURIComponent(i)+"="+encodeURIComponent(n)));var n,i;return r.join("&")}function c(t,e,r,n){const i=new Error("".concat(n," requires an ID for the ").concat(e," type"));if(t){if("POST"!==n&&r.length>0)for(const t of r)if(!t.id)throw i}else{if(r.constructor!==Object||0===Object.keys(r).length)throw new Error("".concat(n," requires a JSON object body"));if("POST"!==n&&!r.id)throw i}}function d(t,e,r,n,i){return n.relationships||(n.relationships={}),t.type||(t.type=e),n.relationships[r]={data:Object.assign(t)},n}function p(t,e,r,n,i){return n.relationships||(n.relationships={}),n.relationships[r]={data:t.map(({id:t,type:r})=>({id:t,type:r||e}))},n}function f(t,e,r){return r.attributes||(r.attributes={}),r.attributes[e]=t,r}function y(t){return Object.prototype.hasOwnProperty.call(t,"id")}function h(t,e,r,n){c(!1,t,e,r);let i={type:t};(null==e?void 0:e.id)&&(i.id=String(e.id));for(const t in e){const r=e[t],s=n.pluralTypes(n.camelCaseTypes(t));null!==r&&r.constructor===Object&&y(r)?i=d(r,s,t,i):null!==r&&Array.isArray(r)&&r.length>0&&y(r[0])?i=p(r,s,t,i):"id"!==t&&"type"!==t&&(i=f(r,t,i))}return{data:i}}t.camel=t=>t.replace(/[-_][a-z\u00E0-\u00F6\u00F8-\u00FE]/g,t=>t.slice(1).toUpperCase()),t.deattribute=e,t.deserialise=function(t){var r,n;if(t)return Array.isArray(t.data)?t=function(t){for(let r of t.data)t.included&&(r=l(r,t.included)),r.relationships&&(r=l(r)),r.attributes&&(r=e(r)),t.data[t.data.indexOf(r)]=r;return t}(t):t.included?t.data=l(t.data,t.included):(null===(r=t.data)||void 0===r?void 0:r.constructor)===Object&&(t.data=l(t.data)),delete t.included,(null===(n=t.data)||void 0===n?void 0:n.attributes)&&(t.data=e(t.data)),t},t.error=r,t.filterIncludes=n,t.kebab=t=>t.charAt(0).toLowerCase()+t.slice(1).replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,t=>"-"+t.toLowerCase()),t.linkRelationships=l,t.query=u,t.serialise=function(t,e={},n="POST",i={}){try{return i.camelCaseTypes||(i.camelCaseTypes=t=>t),i.pluralTypes||(i.pluralTypes=t=>t),null===e||Array.isArray(e)&&0===e.length?{data:e}:(t=i.pluralTypes(i.camelCaseTypes(t)),Array.isArray(e)&&(null==e?void 0:e.length)>0?function(t,e,r,n){c(!0,t,e,r);const i=[];for(const s of e)i.push(h(t,s,r,n).data);return{data:i}}(t,e,n,i):h(t,e,n,i))}catch(t){throw r(t)}},t.snake=t=>t.charAt(0).toLowerCase()+t.slice(1).replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,t=>"_"+t.toLowerCase()),t.splitModel=function(t,e={}){e.pluralModel||(e.pluralModel=t=>t),e.resourceCase||(e.resourceCase=t=>t);const r=t.split("/"),n=r.pop();return r.push(e.pluralModel(e.resourceCase(n))),[n,r.join("/")]},Object.defineProperty(t,"__esModule",{value:!0})}));

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./deattribute.js");require("./error.js");var e=require("./filterIncludes.js");function i({id:i,type:s,meta:n,links:r},l){const o=e.filterIncludes(l,{id:i,type:s});return o.relationships&&a(o,l),n&&(o.meta=n),t.deattribute(o)}function s(t,e,s){t[s]={},t.relationships[s].links&&(t[s].links=t.relationships[s].links),t[s].data=[];for(const n of t.relationships[s].data)t[s].data.push(i(n,e));delete t.relationships[s]}function n(t,e,s){t[s]={},t[s].data=i(t.relationships[s].data,e),t.relationships[s].links&&(t[s].links=t.relationships[s].links),delete t.relationships[s]}function r(t,e,i){t[i]={},t.relationships[i].links&&(t[i].links=t.relationships[i].links),delete t.relationships[i]}function a(t,e=[]){const{relationships:i}=t;for(const a in i)i[a].data&&i[a].data.constructor===Array?s(t,e,a):i[a].data?n(t,e,a):r(t,0,a);return i&&0===Object.keys(i).length&&i.constructor===Object&&delete t.relationships,t}exports.linkRelationships=a;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./deattribute.js");require("./error.js");var i=require("./filterIncludes.js");function t({id:t,type:s,meta:n},r){const a=i.filterIncludes(r,{id:t,type:s});return a.relationships&&l(a,r),n&&(a.meta=n),e.deattribute(a)}function s(e,i,s){e[s]={},e.relationships[s].links&&(e[s].links=e.relationships[s].links),e[s].data=[];for(const n of e.relationships[s].data)e[s].data.push(t(n,i));delete e.relationships[s]}function n(e,i,s){e[s]={},e[s].data=t(e.relationships[s].data,i),e.relationships[s].links&&(e[s].links=e.relationships[s].links),delete e.relationships[s]}function r(e,i){e[i]={},e.relationships[i].links&&(e[i].links=e.relationships[i].links),delete e.relationships[i]}function l(e,i=[]){const{relationships:t}=e;for(const a in t){var l;Array.isArray(null===(l=t[a])||void 0===l?void 0:l.data)?s(e,i,a):t[a].data?n(e,i,a):r(e,a)}return 0===Object.keys(t||[]).length&&(null==t?void 0:t.constructor)===Object&&delete e.relationships,e}exports.linkRelationships=l;

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./error.js");function t(e,t,r,s,a){return s.relationships||(s.relationships={}),e.type||(e.type=t),s.relationships[r]={data:Object.assign(e)},s}function r(e,t,r,s,a){return s.relationships||(s.relationships={}),s.relationships[r]={data:e.map(({id:e,type:r})=>({id:e,type:r||t}))},s}function s(e,t,r){return r.attributes||(r.attributes={}),r.attributes[t]=e,r}function a(e){return Object.prototype.hasOwnProperty.call(e,"id")}exports.serialise=function(n,i={},o="POST",c={}){try{if(c.camelCaseTypes||(c.camelCaseTypes=e=>e),c.pluralTypes||(c.pluralTypes=e=>e),null===i||Array.isArray(i)&&0===i.length)return{data:i};const e=c.pluralTypes(c.camelCaseTypes(n));let l={type:e};!function(e,t,r){if(e.constructor!==Object||0===Object.keys(e).length)throw new Error("".concat(t," requires a JSON object body"));if("POST"!==t&&!e.id)throw new Error("".concat(t," requires an ID for the ").concat(r," type"))}(i,o,e),i.id&&(l.id=String(i.id));for(const e in i){const n=i[e],o=c.pluralTypes(c.camelCaseTypes(e));null!==n&&n.constructor===Object&&a(n)?l=t(n,o,e,l):null!==n&&Array.isArray(n)&&n.length>0&&a(n[0])?l=r(n,o,e,l):"id"!==e&&"type"!==e&&(l=s(n,e,l))}return{data:l}}catch(t){throw e.error(t)}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./error.js");function r(t,r,e,n){const s=new Error("".concat(n," requires an ID for the ").concat(r," type"));if(t){if("POST"!==n&&e.length>0)for(const t of e)if(!t.id)throw s}else{if(e.constructor!==Object||0===Object.keys(e).length)throw new Error("".concat(n," requires a JSON object body"));if("POST"!==n&&!e.id)throw s}}function e(t,r,e,n,s){return n.relationships||(n.relationships={}),t.type||(t.type=r),n.relationships[e]={data:Object.assign(t)},n}function n(t,r,e,n,s){return n.relationships||(n.relationships={}),n.relationships[e]={data:t.map(({id:t,type:e})=>({id:t,type:e||r}))},n}function s(t,r,e){return e.attributes||(e.attributes={}),e.attributes[r]=t,e}function a(t){return Object.prototype.hasOwnProperty.call(t,"id")}function i(t,i,o,l){r(!1,t,i,o);let c={type:t};(null==i?void 0:i.id)&&(c.id=String(i.id));for(const t in i){const r=i[t],o=l.pluralTypes(l.camelCaseTypes(t));null!==r&&r.constructor===Object&&a(r)?c=e(r,o,t,c):null!==r&&Array.isArray(r)&&r.length>0&&a(r[0])?c=n(r,o,t,c):"id"!==t&&"type"!==t&&(c=s(r,t,c))}return{data:c}}exports.serialise=function(e,n={},s="POST",a={}){try{return a.camelCaseTypes||(a.camelCaseTypes=t=>t),a.pluralTypes||(a.pluralTypes=t=>t),null===n||Array.isArray(n)&&0===n.length?{data:n}:(e=a.pluralTypes(a.camelCaseTypes(e)),Array.isArray(n)&&(null==n?void 0:n.length)>0?function(t,e,n,s){r(!0,t,e,n);const a=[];for(const r of e)a.push(i(t,r,n,s).data);return{data:a}}(e,n,s,a):i(e,n,s,a))}catch(r){throw t.error(r)}};
{
"version": "9.0.7",
"version": "9.1.0",
"name": "kitsu-core",

@@ -44,14 +44,14 @@ "description": "Core serialisation and deserialsation functions for the kitsu JSON:API client",

"path": "./lib/index.js",
"limit": "1.5 kb"
"limit": "2 kb"
},
{
"path": "./lib/index.mjs",
"limit": "1.5 kb"
"limit": "2 kb"
},
{
"path": "./lib/index.browser.js",
"limit": "1.5 kb"
"limit": "2 kb"
}
],
"gitHead": "65d3de7037e3a7a658a77b7c641eb894d28ac38e",
"gitHead": "d90350da343c608af82b3b023295c9b36c16d6cf",
"devDependencies": {

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

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

#
#

@@ -44,3 +44,3 @@ ## Features

| -----------: | :----------------: | :--: | :----: | :-----: | :----: | :--: |
| `kitsu-core` | ≤ 1.4 kb | 10+ | 79+ | 68+ | 12.1+ | 18+ |
| `kitsu-core` | ≤ 1.5 kb | 10+ | 67+ | 68+ | 12+ | 18+ |

@@ -121,3 +121,3 @@ \* Including all dependencies, minified & gzipped<br>

[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/deattribute/index.js#L29-L51 "Source code on GitHub")
[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/deattribute/index.js#L29-L51 "Source code on GitHub")

@@ -166,3 +166,3 @@ Hoists attributes to be top-level

[packages/kitsu-core/src/deserialise/index.js:57-74](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/deserialise/index.js#L57-L74 "Source code on GitHub")
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/deserialise/index.js#L57-L72 "Source code on GitHub")

@@ -173,3 +173,3 @@ Deserialises a JSON-API response

- `obj` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The response
- `response` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The raw JSON:API response object

@@ -220,3 +220,3 @@ #### Examples

[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/error/index.js#L27-L33 "Source code on GitHub")
[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/error/index.js#L27-L33 "Source code on GitHub")

@@ -258,3 +258,3 @@ Uniform error handling for Axios, JSON:API and internal package errors. Mutated Error object is rethrown to the caller.

[packages/kitsu-core/src/filterIncludes/index.js:33-46](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/filterIncludes/index.js#L33-L46 "Source code on GitHub")
[packages/kitsu-core/src/filterIncludes/index.js:33-46](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/filterIncludes/index.js#L33-L46 "Source code on GitHub")

@@ -266,3 +266,3 @@ Filters includes for the specific relationship requested

- `included` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The response included object
- `relationship` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `relationship` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `relationship.id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The relationship ID

@@ -299,3 +299,3 @@ - `relationship.type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The relationship type

[packages/kitsu-core/src/linkRelationships/index.js:98-118](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/linkRelationships/index.js#L98-L118 "Source code on GitHub")
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/linkRelationships/index.js#L97-L117 "Source code on GitHub")

@@ -338,3 +338,3 @@ Links relationships to included data

[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/query/index.js#L33-L44 "Source code on GitHub")
[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/query/index.js#L33-L44 "Source code on GitHub")

@@ -367,3 +367,3 @@ Constructs a URL query string for JSON:API parameters

[packages/kitsu-core/src/serialise/index.js:119-152](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/serialise/index.js#L119-L152 "Source code on GitHub")
[packages/kitsu-core/src/serialise/index.js:188-202](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/serialise/index.js#L188-L202 "Source code on GitHub")

@@ -374,4 +374,4 @@ Serialises an object into a JSON-API structure

- `model` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Request model
- `obj` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The data (optional, default `{}`)
- `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource type
- `data` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** The data (optional, default `{}`)
- `method` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Request type (PATCH, POST, DELETE) (optional, default `'POST'`)

@@ -415,3 +415,3 @@ - `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional configuration for camelCase and pluralisation handling (optional, default `{}`)

[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/splitModel/index.js#L29-L39 "Source code on GitHub")
[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/splitModel/index.js#L29-L39 "Source code on GitHub")

@@ -423,3 +423,3 @@ Split model name from the model's resource URL

- `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** URL path for the model
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `options.resourceCase` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Convert libraryEntries to library-entries or library_entries (default no conversion). To use parameter, import kebab or snake from kitsu-core

@@ -460,3 +460,3 @@ - `options.pluralModel` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Pluralise models (default no pluralisation). To use parameter, import pluralize (or another pluralisation npm package)

[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/camel/index.js#L14-L14 "Source code on GitHub")
[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/camel/index.js#L14-L14 "Source code on GitHub")

@@ -489,3 +489,3 @@ Converts kebab-case and snake_case into camelCase

[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/kebab/index.js#L11-L11 "Source code on GitHub")
[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/kebab/index.js#L11-L11 "Source code on GitHub")

@@ -508,3 +508,3 @@ Converts camelCase into kebab-case

[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/b67829002325934b88c342ed3344f48113ce843e/packages/kitsu-core/src/snake/index.js#L11-L11 "Source code on GitHub")
[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/c0136dcfd6fd0700ebbc9bde10da6d57656072bc/packages/kitsu-core/src/snake/index.js#L11-L11 "Source code on GitHub")

@@ -511,0 +511,0 @@ Converts camelCase into snake_case

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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