![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
sarala-json-api-data-formatter
Advanced tools
Simple and fluent framework agnostic javascript library to transform standard JSON API responses to simple JSON objects and vice versa.
A fluent, framework-agnostic, JavaScript library, that can be used simply, to transform standard JSON API responses to simple JSON objects and vice versa.
$ npm i sarala-json-api-data-formatter --save
$ yarn add sarala-json-api-data-formatter
const data = {
"data": {
"type": "posts",
"id": "1",
"attributes": {
"slug": "voluptates-laborum-non-voluptatem-ducimus-veniam-et",
"title": "Voluptates laborum non voluptatem ducimus veniam et.",
"subtitle": "Cumque aut laudantium repudiandae rem repellendus voluptatem. Sunt ipsa eum ea molestias.",
"body": "Est quod itaque suscipit quidem dolor dolores velit. Nihil voluptas placeat ex consequatur quasi.\n\nEst nulla cupiditate ad beatae rerum veritatis vel. Quia ut doloribus consequatur porro. Eligendi sit et dignissimos qui voluptatem magnam mollitia labore.\n\nLibero saepe praesentium et sed. Exercitationem error rerum sit inventore provident laborum. Fuga pariatur dolor reiciendis. Quibusdam corrupti commodi ut quo non laboriosam quia. Nihil sit iste sit optio voluptas repellendus exercitationem.",
"published_at": "2018-01-25"
},
"links": {
"self": "https://sarala-demo.app/api/posts/1"
},
"relationships": {
"tags": {
"links": {
"self": "https://sarala-demo.app/api/posts/1/relationships/tags",
"related": "https://sarala-demo.app/api/posts/1/tags"
},
"data": [
{
"type": "tags",
"id": "1"
},
{
"type": "tags",
"id": "15"
}
]
}
}
},
"included": [
{
"type": "tags",
"id": "1",
"attributes": {
"name": "voluptates"
},
"links": {
"self": "https://sarala-demo.app/api/tags/1"
}
},
{
"type": "tags",
"id": "15",
"attributes": {
"name": "dolorum"
},
"links": {
"self": "https://sarala-demo.app/api/tags/15"
}
}
]
};
const simpleObject = {
"id": "1",
"type": "posts",
"links": {
"self": "https://sarala-demo.app/api/posts/1"
},
"slug": "voluptates-laborum-non-voluptatem-ducimus-veniam-et",
"title": "Voluptates laborum non voluptatem ducimus veniam et.",
"subtitle": "Cumque aut laudantium repudiandae rem repellendus voluptatem. Sunt ipsa eum ea molestias.",
"body": "Est quod itaque suscipit quidem dolor dolores velit. Nihil voluptas placeat ex consequatur quasi.\n\nEst nulla cupiditate ad beatae rerum veritatis vel. Quia ut doloribus consequatur porro. Eligendi sit et dignissimos qui voluptatem magnam mollitia labore.\n\nLibero saepe praesentium et sed. Exercitationem error rerum sit inventore provident laborum. Fuga pariatur dolor reiciendis. Quibusdam corrupti commodi ut quo non laboriosam quia. Nihil sit iste sit optio voluptas repellendus exercitationem.",
"published_at": "2018-01-25",
"relationships": [
"tags"
],
"tags": {
"links": {
"self": "https://sarala-demo.app/api/posts/1/relationships/tags",
"related": "https://sarala-demo.app/api/posts/1/tags"
},
"data_collection": true,
"data": [
{
"id": "1",
"type": "tags",
"links": {
"self": "https://sarala-demo.app/api/tags/1"
},
"name": "voluptates"
},
{
"id": "15",
"type": "tags",
"links": {
"self": "https://sarala-demo.app/api/tags/15"
},
"name": "dolorum"
}
]
}
};
import { Formatter } from "sarala-json-api-data-formatter";
const formatter = new Formatter();
let data = this.deserialize(data);
import { Formatter } from "sarala-json-api-data-formatter";
const formatter = new Formatter();
let data = this.serialize(data);
let data = this.includeOnly([]).deserialize(data);
When post has tags and comments, following will deserialize only root object and comments. Tags will be skipped.
let data = this.includeOnly(['comments']).deserialize(data);
let data = this.filterFields({
posts: ['title', 'subtitle'],
tags: ['name']
}).deserialize(data);
The
serialize
method can be used similarly withincludeOnly
andfilterFields
.
npm run t
# run test with watch
npm run tw
npm run cc
npm run cs
FAQs
Simple and fluent framework agnostic javascript library to transform standard JSON API responses to simple JSON objects and vice versa.
The npm package sarala-json-api-data-formatter receives a total of 234 weekly downloads. As such, sarala-json-api-data-formatter popularity was classified as not popular.
We found that sarala-json-api-data-formatter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.