Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-resource-case-converter

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-resource-case-converter - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

4

dist/vue-resource-case-converter.js

@@ -12,3 +12,3 @@ 'use strict';

function snakeCase(string) {
function camelCase(string) {
var find = /(\_\w)/g;

@@ -21,3 +21,3 @@ var convert = function convert(matches) {

function camelCase(string) {
function snakeCase(string) {
var find = /([A-Z])/g;

@@ -24,0 +24,0 @@ var convert = function convert(matches) {

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

"use strict";function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function snakeCase(e){var t=/(\_\w)/g,r=function(e){return e[1].toUpperCase()};return e.replace(t,r)}function camelCase(e){var t=/([A-Z])/g,r=function(e){return"_"+e.toLowerCase()};return e.replace(t,r)}function getClass(e){var t=Object.prototype.toString.call(e);return t.match(/\[object (.+)\]/)[1]}function convertObjectKeys(e,t){return"Object"!==getClass(e)&&"Array"!==getClass(e)?e:Object.keys(e).reduce(function(r,n){return Object.assign(r,_defineProperty({},t(n),convertObjectKeys(e[n],t))),r},Array.isArray(e)?[]:{})}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},VueResourceCaseConverter={install:function(e,t){var r=function(){return!0},n=function(){return!0};return null!=t&&t.requestUrlFilter&&(r=t.requestUrlFilter),null!=t&&t.responseUrlFilter&&(n=t.responseUrlFilter),null==e.http?void(void 0).$log("Please add http-resource plugin to your Vue instance"):void e.http.interceptors.push(function(e,t){r(e.url)&&Object.assign(e,{params:convertObjectKeys(e.params,snakeCase),body:convertObjectKeys(e.body,snakeCase)}),t(function(e){if(!n(e.url))return e;var t=void 0;try{t=JSON.parse(e.body)}catch(t){return e}var r=convertObjectKeys(t,camelCase);return Object.assign(e,{body:JSON.stringify(r)}),e})})}};"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports&&(module.exports=VueResourceCaseConverter);
"use strict";function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function camelCase(e){var t=/(\_\w)/g,r=function(e){return e[1].toUpperCase()};return e.replace(t,r)}function snakeCase(e){var t=/([A-Z])/g,r=function(e){return"_"+e.toLowerCase()};return e.replace(t,r)}function getClass(e){var t=Object.prototype.toString.call(e);return t.match(/\[object (.+)\]/)[1]}function convertObjectKeys(e,t){return"Object"!==getClass(e)&&"Array"!==getClass(e)?e:Object.keys(e).reduce(function(r,n){return Object.assign(r,_defineProperty({},t(n),convertObjectKeys(e[n],t))),r},Array.isArray(e)?[]:{})}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},VueResourceCaseConverter={install:function(e,t){var r=function(){return!0},n=function(){return!0};return null!=t&&t.requestUrlFilter&&(r=t.requestUrlFilter),null!=t&&t.responseUrlFilter&&(n=t.responseUrlFilter),null==e.http?void(void 0).$log("Please add http-resource plugin to your Vue instance"):void e.http.interceptors.push(function(e,t){r(e.url)&&Object.assign(e,{params:convertObjectKeys(e.params,snakeCase),body:convertObjectKeys(e.body,snakeCase)}),t(function(e){if(!n(e.url))return e;var t=void 0;try{t=JSON.parse(e.body)}catch(t){return e}var r=convertObjectKeys(t,camelCase);return Object.assign(e,{body:JSON.stringify(r)}),e})})}};"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports&&(module.exports=VueResourceCaseConverter);
{
"name": "vue-resource-case-converter",
"version": "1.0.4",
"version": "1.0.5",
"description": "Vue resource plugin to convert request json keys to snake_case and response json keys to camelCase",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,3 @@ //

function snakeCase (string) {
function camelCase (string) {
let find = /(\_\w)/g;

@@ -15,3 +15,3 @@ let convert = function(matches) {

function camelCase (string) {
function snakeCase (string) {
let find = /([A-Z])/g;

@@ -18,0 +18,0 @@ let convert = function(matches) {

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