Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-resource-case-converter
Advanced tools
Vue resource plugin to convert request json keys to snake_case and response json keys to camelCase
Module attaches interceptors to vue instance which process request and responses to convert keys on JSON objects to camelCase for responses and snake_case for requests.
Your vue instance should have vue-resource
plugin installed and connected.
Very often popular backends use snake case as their default code style, while camel case is usually used in javascript.
This module can be used to keep consistent code style on both backend and your vue frontend.
$ npm i vue-resource-case-converter
Then in your code:
const Vue = require('vue');
const VueResource = require('vue-resource');
const VueResourceCaseConverter = require('vue-resource-case-converter');
Vue.use(VueResource);
Vue.use(VueResourceCaseConverter);
In order to restrict certain urls from converting,
you can do it by providing responseUrlFilter
or requestUrlFilter
function to
configuration object. These functions receive url
and should return true for url
to be processed by interceptor.
Vue.use(VueResourceCaseConverter, {
responseUrlFilter(url) {
// Your custom logic
// For example:
// return url.indexOf('api') >= 0;
},
requestUrlFilter(url) {
// Your custom logic
},
});
This plugin was inspired by this angular.js version.
FAQs
Vue resource plugin to convert request json keys to snake_case and response json keys to camelCase
The npm package vue-resource-case-converter receives a total of 3 weekly downloads. As such, vue-resource-case-converter popularity was classified as not popular.
We found that vue-resource-case-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.