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

gangway

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gangway - npm Package Compare versions

Comparing version 1.4.0-rc to 1.4.0

src/singularize.js

3

CHANGELOG.md

@@ -5,5 +5,4 @@ # Changelog

_Currently release candidate at `gangway@1.4.0-rc`._
- Added `Accept: "application/json" default header
- Internal change: remove dependency on inflection library.

@@ -10,0 +9,0 @@ ## 1.3.1

{
"name": "gangway",
"version": "1.4.0-rc",
"version": "1.4.0",
"description": "A client-side API abstraction layer",

@@ -22,3 +22,2 @@ "engines": {

"dependencies": {
"inflected": "1.1.6",
"promise": "~7.1",

@@ -25,0 +24,0 @@ "superagent": "~1.7"

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

var Inflector = require('inflected')
var singularize = require('./singularize')
var url = require('./url')

@@ -8,4 +8,4 @@

return segment + (i === segments.length - 1 ? '' : '/{' + Inflector.singularize(segment) + '_id}')
return segment + (i === segments.length - 1 ? '' : '/{' + singularize(segment) + '_id}')
}).reduce(url.resolve, '')
}

@@ -197,4 +197,20 @@ var API = require('../src/api')

it ('does not add additional post parameters', function(done) {
var api = API({
baseURL: 'http://example.com'
})
var users = api.resource('users')
var notes = users.resource('notes')
fauxJax.on('request', function(request) {
assert.equal('note' in JSON.parse(request.requestBody), false)
done()
})
notes.create({ body: { description: 'hi' }, params: { user_id: 1 }})
})
})
})
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