kitsu-core
Advanced tools
Comparing version 9.1.23 to 9.1.24
@@ -6,2 +6,10 @@ # Change Log | ||
## [9.1.24](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/compare/v9.1.23...v9.1.24) (2022-02-17) | ||
**Note:** Version bump only for package kitsu-core | ||
## [9.1.23](https://github.com/wopian/kitsu/tree/master/packages/kitsu-core/compare/v9.1.22...v9.1.23) (2022-01-23) | ||
@@ -8,0 +16,0 @@ |
@@ -7,5 +7,3 @@ 'use strict'; | ||
if (typeof data === 'object' && data !== null) { | ||
var _data$attributes; | ||
if (Array.isArray(data)) data.map(el => deattribute(el));else if (((_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.constructor) === Object) { | ||
if (Array.isArray(data)) data.map(el => deattribute(el));else if (typeof data.attributes === 'object' && !Array.isArray(data.attributes) && data.attributes !== null) { | ||
for (const key of Object.keys(data.attributes)) { | ||
@@ -12,0 +10,0 @@ if (!data.attributes.attributes) { |
@@ -22,8 +22,8 @@ 'use strict'; | ||
function deserialise(response) { | ||
var _response$data, _response$data2; | ||
var _response$data; | ||
if (!response) return; | ||
if (Array.isArray(response.data)) response = deserialiseArray(response);else if (response.included) response.data = linkRelationships.linkRelationships(response.data, response.included);else if (((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.constructor) === Object) response.data = linkRelationships.linkRelationships(response.data); | ||
if (Array.isArray(response.data)) response = deserialiseArray(response);else if (response.included) response.data = linkRelationships.linkRelationships(response.data, response.included);else if (typeof response.data === 'object' && response.data !== null) response.data = linkRelationships.linkRelationships(response.data); | ||
delete response.included; | ||
if ((_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.attributes) response.data = deattribute.deattribute(response.data); | ||
if ((_response$data = response.data) !== null && _response$data !== void 0 && _response$data.attributes) response.data = deattribute.deattribute(response.data); | ||
return response; | ||
@@ -30,0 +30,0 @@ } |
@@ -9,5 +9,3 @@ (function (global, factory) { | ||
if (typeof data === 'object' && data !== null) { | ||
var _data$attributes; | ||
if (Array.isArray(data)) data.map(el => deattribute(el));else if (((_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.constructor) === Object) { | ||
if (Array.isArray(data)) data.map(el => deattribute(el));else if (typeof data.attributes === 'object' && !Array.isArray(data.attributes) && data.attributes !== null) { | ||
for (const key of Object.keys(data.attributes)) { | ||
@@ -116,3 +114,3 @@ if (!data.attributes.attributes) { | ||
if (Object.keys(relationships || []).length === 0 && (relationships === null || relationships === void 0 ? void 0 : relationships.constructor) === Object) { | ||
if (Object.keys(relationships || []).length === 0 && typeof relationships === 'object' && !Array.isArray(relationships) && relationships !== null) { | ||
delete data.relationships; | ||
@@ -136,8 +134,8 @@ } | ||
function deserialise(response) { | ||
var _response$data, _response$data2; | ||
var _response$data; | ||
if (!response) return; | ||
if (Array.isArray(response.data)) response = deserialiseArray(response);else if (response.included) response.data = linkRelationships(response.data, response.included);else if (((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.constructor) === Object) response.data = linkRelationships(response.data); | ||
if (Array.isArray(response.data)) response = deserialiseArray(response);else if (response.included) response.data = linkRelationships(response.data, response.included);else if (typeof response.data === 'object' && response.data !== null) response.data = linkRelationships(response.data); | ||
delete response.included; | ||
if ((_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.attributes) response.data = deattribute(response.data); | ||
if ((_response$data = response.data) !== null && _response$data !== void 0 && _response$data.attributes) response.data = deattribute(response.data); | ||
return response; | ||
@@ -290,6 +288,6 @@ } | ||
if (node !== null && (node === null || node === void 0 ? void 0 : node.constructor) === Object && hasID(node)) { | ||
if (node !== null && Array.isArray(node) && node.length > 0 && hasID(node[0])) { | ||
data = serialiseArray(node, nodeType, key, data); | ||
} else if (node !== null && typeof node === 'object' && hasID(node)) { | ||
data = serialiseObject(node, nodeType, key, data); | ||
} else if (node !== null && Array.isArray(node) && node.length > 0 && hasID(node[0])) { | ||
data = serialiseArray(node, nodeType, key, data); | ||
} else if (key !== 'id' && key !== 'type') { | ||
@@ -296,0 +294,0 @@ data = serialiseAttr(node, key, data); |
@@ -65,3 +65,3 @@ 'use strict'; | ||
if (Object.keys(relationships || []).length === 0 && (relationships === null || relationships === void 0 ? void 0 : relationships.constructor) === Object) { | ||
if (Object.keys(relationships || []).length === 0 && typeof relationships === 'object' && !Array.isArray(relationships) && relationships !== null) { | ||
delete data.relationships; | ||
@@ -68,0 +68,0 @@ } |
@@ -135,6 +135,6 @@ 'use strict'; | ||
if (node !== null && (node === null || node === void 0 ? void 0 : node.constructor) === Object && hasID(node)) { | ||
if (node !== null && Array.isArray(node) && node.length > 0 && hasID(node[0])) { | ||
data = serialiseArray(node, nodeType, key, data); | ||
} else if (node !== null && typeof node === 'object' && hasID(node)) { | ||
data = serialiseObject(node, nodeType, key, data); | ||
} else if (node !== null && Array.isArray(node) && node.length > 0 && hasID(node[0])) { | ||
data = serialiseArray(node, nodeType, key, data); | ||
} else if (key !== 'id' && key !== 'type') { | ||
@@ -141,0 +141,0 @@ data = serialiseAttr(node, key, data); |
{ | ||
"version": "9.1.23", | ||
"version": "9.1.24", | ||
"name": "kitsu-core", | ||
@@ -4,0 +4,0 @@ "description": "Simple, lightweight & framework agnostic JSON:API (de)serialsation components", |
@@ -41,3 +41,3 @@ <h1 align=center>Kitsu Core</h1> | ||
| -----------: | :----------------: | :--: | :----: | :-----: | :----: | :--: | | ||
| `kitsu-core` | ≤ 1.5 kb | 10+ | 72+ | 78+ | 12.1+ | 86+ | | ||
| `kitsu-core` | ≤ 1.5 kb | 10+ | 83+ | 78+ | 13.1+ | 95+ | | ||
@@ -66,6 +66,6 @@ \* Minified with brotli | ||
<!-- jsDelivr --> | ||
<script src='https://cdn.jsdelivr.net/npm/kitsu-core'></script> | ||
<script src="https://cdn.jsdelivr.net/npm/kitsu-core"></script> | ||
<!-- unpkg --> | ||
<script src='https://unpkg.com/kitsu-core'></script> | ||
<script src="https://unpkg.com/kitsu-core"></script> | ||
``` | ||
@@ -119,3 +119,3 @@ | ||
[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/deattribute/index.js#L29-L51 "Source code on GitHub") | ||
@@ -162,3 +162,3 @@ Hoists attributes to be top-level | ||
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/packages/kitsu-core/src/deserialise/index.js#L57-L72 "Source code on GitHub") | ||
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/deserialise/index.js#L57-L72 "Source code on GitHub") | ||
@@ -213,3 +213,3 @@ Deserialises a JSON-API response | ||
[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/error/index.js#L27-L33 "Source code on GitHub") | ||
@@ -251,3 +251,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/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/filterIncludes/index.js#L33-L46 "Source code on GitHub") | ||
@@ -292,3 +292,3 @@ Filters includes for the specific relationship requested | ||
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/packages/kitsu-core/src/linkRelationships/index.js#L97-L117 "Source code on GitHub") | ||
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/linkRelationships/index.js#L97-L117 "Source code on GitHub") | ||
@@ -331,3 +331,3 @@ Links relationships to included data | ||
[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/query/index.js#L33-L44 "Source code on GitHub") | ||
@@ -360,3 +360,3 @@ Constructs a URL query string for JSON:API parameters | ||
[packages/kitsu-core/src/serialise/index.js:249-260](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/packages/kitsu-core/src/serialise/index.js#L249-L260 "Source code on GitHub") | ||
[packages/kitsu-core/src/serialise/index.js:249-260](https://github.com/wopian/kitsu/blob/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/serialise/index.js#L249-L260 "Source code on GitHub") | ||
@@ -406,3 +406,3 @@ Serialises an object into a JSON-API structure | ||
[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/splitModel/index.js#L29-L39 "Source code on GitHub") | ||
@@ -449,3 +449,3 @@ Split model name from the model's resource URL | ||
[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/camel/index.js#L14-L14 "Source code on GitHub") | ||
@@ -476,3 +476,3 @@ Converts kebab-case and snake_case into camelCase | ||
[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/kebab/index.js#L11-L11 "Source code on GitHub") | ||
@@ -495,3 +495,3 @@ Converts camelCase into kebab-case | ||
[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/60b2be15cce2e948e2dc05415ae49f21cf546615/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/1fe32f56d566a434cc4b5723114013e9c08dca61/packages/kitsu-core/src/snake/index.js#L11-L11 "Source code on GitHub") | ||
@@ -498,0 +498,0 @@ Converts camelCase into snake_case |
declare function _default(input: string): string; | ||
export default _default; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ export * from "./deattribute"; |
declare function _default(input: string): string; | ||
export default _default; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
declare function _default(input: string): string; | ||
export default _default; |
@@ -0,0 +0,0 @@ /** |
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
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
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
80516
1167