Comparing version 2.0.0-alpha to 2.0.0-alpha-2
{ | ||
"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() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48423
868