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 2.0.0-alpha to 2.0.0-alpha-2

2

package.json
{
"name": "gangway",
"version": "2.0.0-alpha",
"version": "2.0.0-alpha-2",
"description": "A client-side API abstraction layer",

@@ -5,0 +5,0 @@ "engines": {

@@ -37,4 +37,3 @@ /**

}) : memo
}, {})
}
var singularize = require('./singularize')
var url = require('./url')
module.exports = function segmentaize (segments) {
module.exports = function segmentize (segments) {

@@ -6,0 +6,0 @@ return segments.map(function(segment, i) {

@@ -21,2 +21,7 @@ var parameterizeRoute = require('./parameterizeRoute')

// Normalize the base url
if (base.slice(-1) !== '/') {
base += '/'
}
base = base.replace(trimRight, '')

@@ -23,0 +28,0 @@ path = path.replace(trimLeft, '')

@@ -34,2 +34,12 @@ var API = require('../src/api')

it ('respects baseURLs with paths', function() {
var api = new API({
baseURL: 'http://example.com/api/'
})
var foo = api.namespace('foo')
var bar = foo.namespace('bar')
assert.equal(bar.toString(), 'http://example.com/api/foo/{foo_id}/bar')
})
it ('toString singularizes parameters segments', function() {

@@ -36,0 +46,0 @@ var api = new API()

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