New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rails-request-json

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails-request-json - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

18

index.js
import { FetchRequest } from '@rails/request.js'
const makeRequest = (verb, url, payload) => {
const request = new FetchRequest(verb, url, {
const request = (verb, url, payload) => {
const req = new FetchRequest(verb, url, {
headers: { Accept: "application/json" },
body: payload,
})
return request.perform().then(response => {
return req.perform().then(response => {
if(response.response.headers.get('Content-Length') > 0) {

@@ -15,8 +15,8 @@ return response.json

const get = (url, payload) => makeRequest('get', url, payload)
const post = (url, payload) => makeRequest('post', url, payload)
const put = (url, payload) => makeRequest('put', url, payload)
const patch = (url, payload) => makeRequest('patch', url, payload)
const destroy = (url, payload) => makeRequest('delete', url, payload)
const get = (url, payload) => request('get', url, payload)
const post = (url, payload) => request('post', url, payload)
const put = (url, payload) => request('put', url, payload)
const patch = (url, payload) => request('patch', url, payload)
const destroy = (url, payload) => request('delete', url, payload)
export { get, post, put, patch, destroy }
export { request, get, post, put, patch, destroy }
{
"name": "rails-request-json",
"version": "0.0.1",
"version": "0.1.0",
"description": "JSON shorthand functions for @rails/request.js",
"main": "index.js",
"author": "Micah Geisel <micah@botandrose.com>",
"repository": "https://github.com/botandrose/rails-request-json",
"license": "ISC",

@@ -8,0 +9,0 @@ "dependencies": {

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