ts-japi
Advanced tools
Comparing version 1.11.3 to 1.11.4
{ | ||
".": "1.11.3" | ||
".": "1.11.4" | ||
} |
# Changelog | ||
## [1.11.4](https://github.com/mathematic-inc/ts-japi/compare/v1.11.3...v1.11.4) (2024-05-13) | ||
### Bug Fixes | ||
* [#92](https://github.com/mathematic-inc/ts-japi/issues/92) re-sort data after serialization ([#93](https://github.com/mathematic-inc/ts-japi/issues/93)) ([aeae3a7](https://github.com/mathematic-inc/ts-japi/commit/aeae3a7aacf2c2e9c514f982070ba4d1b8fe6727)) | ||
## [1.11.3](https://github.com/mathematic-inc/ts-japi/compare/v1.11.2...v1.11.3) (2024-04-19) | ||
@@ -4,0 +11,0 @@ |
@@ -44,2 +44,11 @@ "use strict"; | ||
}, document); | ||
// Sort data to match input order - this is important for cases where | ||
// data has been sorted prior to serialization. | ||
if (Array.isArray(document.data)) { | ||
document.data = document.data.sort((a, b) => { | ||
const aIndex = data.findIndex((datum) => datum.id === a.id); | ||
const bIndex = data.findIndex((datum) => datum.id === b.id); | ||
return aIndex - bIndex; | ||
}); | ||
} | ||
// Handle meta | ||
@@ -46,0 +55,0 @@ if (options?.metaizers?.document) { |
{ | ||
"name": "ts-japi", | ||
"version": "1.11.3", | ||
"version": "1.11.4", | ||
"description": "A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
238832
3509