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

kitsu-core

Package Overview
Dependencies
Maintainers
1
Versions
123
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 8.1.1 to 8.2.0

25

CHANGELOG.md

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

# [8.2.0](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/compare/v8.1.1...v8.2.0) (2020-04-26)
### Build System / Dependencies
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib… ([#375](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/issues/375)) ([d8bc45d](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/d8bc45d))
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib… ([#379](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/issues/379)) ([7efdc07](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/7efdc07))
* **kitsu:** update devdependency [@size-limit](https://github.com/size-limit)/preset-small-lib… ([#383](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/issues/383)) ([d86a1e6](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/d86a1e6))
### Chores
* **release:** update documentation ([ef7efec](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/ef7efec))
* remove trailing spaces ([16d33a7](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/16d33a7))
* undo formatting changes in [#395](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/issues/395) ([a4d7b23](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/a4d7b23))
### New Features
* **kitsu-core:** optional pluralisation during serialisation ([#395](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/issues/395)) ([c2e6f02](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/commit/c2e6f02))
## [8.1.1](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/compare/v8.1.0...v8.1.1) (2020-02-28)

@@ -8,0 +33,0 @@

2

lib/index.browser.js

@@ -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){return"object"==typeof t&&null!==t&&(Array.isArray(t)?t.map(t=>e(t)):t.attributes&&t.attributes.constructor===Object&&(Object.keys(t.attributes).forEach(e=>{t[e]=t.attributes[e]}),delete t.attributes)),t}function r(t){if(t.response){const e=t.response.data;e&&e.errors&&(t.errors=e.errors)}throw t}function n(t,e){let{id:n,type:o}=e;try{const e=t.filter(t=>t.id===n&&t.type===o)[0]||{id:n,type:o};return Object.assign({},e)}catch(t){r(t)}}function o(t,r){let{id:o,type:i,meta:a}=t;const c=n(r,{id:o,type:i});return c.relationships&&s(c,r),a&&(c.meta=a),e(c)}function i(t,e,r){t[r]=[];for(const n of t.relationships[r].data)t[r].push(o(n,e))}function a(t,e,r){t[r]=o(t.relationships[r].data,e),delete t[r].relationships}function s(t,e){const{relationships:r}=t;let n=!1;for(const o in r)r[o].data&&Array.isArray(r[o].data)?(i(t,e,o),n=!0):r[o].data&&(a(t,e,o),n=!0);return n&&delete t.relationships,t}function c(t,e){return null!==t&&"object"==typeof t?u(t,e):encodeURIComponent(e)+"="+encodeURIComponent(t)}function u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=[];for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(c(t[n],e?"".concat(e,"[").concat(n,"]"):n));return r.join("&")}const l=(t,e)=>"".concat(t," requires an ID for the ").concat(e," relationships");function d(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"))}function p(t,e,r,n,o){if("string"!=typeof t.id)throw new Error(l(o,r));return n.relationships||(n.relationships={}),t.type||(t.type=e),n.relationships[r]={data:Object.assign(t)},n}function f(t,e,r,n,o){return n.relationships||(n.relationships={}),n.relationships[r]={data:t.map(t=>{let{id:n,type:i}=t;if(!n)throw new Error(l(o,r));return{id:n,type:i||e}})},n}function h(t,e,r){return r.attributes||(r.attributes={}),r.attributes[e]=t,r}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=s(r,t.included)),r.attributes&&(r=e(r)),t.data[t.data.indexOf(r)]=r;return t}(t):t.included&&(t.data=s(t.data,t.included)),delete t.included,t.data&&t.data.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=s,t.query=u,t.serialise=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST";try{const r=this.plural(this.camel(t));let o={type:r};d(e,n,r),e.id&&(o.id=String(e.id));for(const t in e){const r=e[t],i=this.plural(this.camel(t));null!==r&&r.constructor===Object?o=p(r,i,t,o,n):null!==r&&Array.isArray(r)?o=f(r,i,t,o,n):"id"!==t&&"type"!==t&&(o=h(r,t,o))}return{data:o}}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()),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){return"object"==typeof t&&null!==t&&(Array.isArray(t)?t.map(t=>e(t)):t.attributes&&t.attributes.constructor===Object&&(Object.keys(t.attributes).forEach(e=>{t[e]=t.attributes[e]}),delete t.attributes)),t}function r(t){if(t.response){const e=t.response.data;e&&e.errors&&(t.errors=e.errors)}throw t}function n(t,e){let{id:n,type:i}=e;try{const e=t.filter(t=>t.id===n&&t.type===i)[0]||{id:n,type:i};return Object.assign({},e)}catch(t){r(t)}}function i(t,r){let{id:i,type:o,meta:a}=t;const c=n(r,{id:i,type:o});return c.relationships&&s(c,r),a&&(c.meta=a),e(c)}function o(t,e,r){t[r]=[];for(const n of t.relationships[r].data)t[r].push(i(n,e))}function a(t,e,r){t[r]=i(t.relationships[r].data,e),delete t[r].relationships}function s(t,e){const{relationships:r}=t;let n=!1;for(const i in r)r[i].data&&Array.isArray(r[i].data)?(o(t,e,i),n=!0):r[i].data&&(a(t,e,i),n=!0);return n&&delete t.relationships,t}function c(t,e){return null!==t&&"object"==typeof t?u(t,e):encodeURIComponent(e)+"="+encodeURIComponent(t)}function u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=[];for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(c(t[n],e?"".concat(e,"[").concat(n,"]"):n));return r.join("&")}const l=(t,e)=>"".concat(t," requires an ID for the ").concat(e," relationships");function d(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"))}function p(t,e,r,n,i){if("string"!=typeof t.id)throw new Error(l(i,r));return n.relationships||(n.relationships={}),t.type||(t.type=e),n.relationships[r]={data:Object.assign(t)},n}function f(t,e,r,n,i){return n.relationships||(n.relationships={}),n.relationships[r]={data:t.map(t=>{let{id:n,type:o}=t;if(!n)throw new Error(l(i,r));return{id:n,type:o||e}})},n}function h(t,e,r){return r.attributes||(r.attributes={}),r.attributes[e]=t,r}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=s(r,t.included)),r.attributes&&(r=e(r)),t.data[t.data.indexOf(r)]=r;return t}(t):t.included&&(t.data=s(t.data,t.included)),delete t.included,t.data&&t.data.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=s,t.query=u,t.serialise=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST";try{const r=this.plural?this.plural(this.camel(t)):this.camel(t);let i={type:r};d(e,n,r),e.id&&(i.id=String(e.id));for(const t in e){const r=e[t],o=this.plural?this.plural(this.camel(t)):this.camel(t);null!==r&&r.constructor===Object?i=p(r,o,t,i,n):null!==r&&Array.isArray(r)?i=f(r,o,t,i,n):"id"!==t&&"type"!==t&&(i=h(r,t,i))}return{data: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()),Object.defineProperty(t,"__esModule",{value:!0})}));

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

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

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

],
"gitHead": "8d060f37ff2d5e098983a57afb33d0a281042ae8",
"gitHead": "7164fae3ffbb2f9a1e8f20b636794f26395dd8af",
"devDependencies": {
"@size-limit/preset-small-lib": "~4.0.1"
"@size-limit/preset-small-lib": "~4.4.0"
}
}

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

[packages/kitsu-core/src/deattribute/index.js:29-38](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/deattribute/index.js#L29-L38 "Source code on GitHub")
[packages/kitsu-core/src/deattribute/index.js:29-38](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/deattribute/index.js#L29-L38 "Source code on GitHub")

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

[packages/kitsu-core/src/deserialise/index.js:56-72](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/deserialise/index.js#L56-L72 "Source code on GitHub")
[packages/kitsu-core/src/deserialise/index.js:56-72](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/deserialise/index.js#L56-L72 "Source code on GitHub")

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

[packages/kitsu-core/src/error/index.js:7-13](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/error/index.js#L7-L13 "Source code on GitHub")
[packages/kitsu-core/src/error/index.js:7-13](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/error/index.js#L7-L13 "Source code on GitHub")

@@ -224,3 +224,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:12-21](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/filterIncludes/index.js#L12-L21 "Source code on GitHub")
[packages/kitsu-core/src/filterIncludes/index.js:12-21](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/filterIncludes/index.js#L12-L21 "Source code on GitHub")

@@ -240,3 +240,3 @@ Filters includes for the specific relationship

[packages/kitsu-core/src/linkRelationships/index.js:55-74](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/linkRelationships/index.js#L55-L74 "Source code on GitHub")
[packages/kitsu-core/src/linkRelationships/index.js:55-74](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/linkRelationships/index.js#L55-L74 "Source code on GitHub")

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

[packages/kitsu-core/src/query/index.js:21-32](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/query/index.js#L21-L32 "Source code on GitHub")
[packages/kitsu-core/src/query/index.js:21-32](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/query/index.js#L21-L32 "Source code on GitHub")

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

[packages/kitsu-core/src/serialise/index.js:96-121](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/packages/kitsu-core/src/serialise/index.js#L96-L121 "Source code on GitHub")
[packages/kitsu-core/src/serialise/index.js:96-121](https://github.com/wopian/kitsu/blob/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/serialise/index.js#L96-L121 "Source code on GitHub")

@@ -293,3 +293,3 @@ Serialises an object into a JSON-API structure

[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/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/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/camel/index.js#L14-L14 "Source code on GitHub")

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

[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/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/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/kebab/index.js#L11-L11 "Source code on GitHub")

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

[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/6ca6f628dbd9301c30ca80fc20c1861ee6cd8cc7/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/82b8eb4223c32ee16b3a6aec132ef843bf567493/packages/kitsu-core/src/snake/index.js#L11-L11 "Source code on GitHub")

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

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