Comparing version 2.0.0-alpha-2 to 2.0.0-alpha-3
{ | ||
"name": "gangway", | ||
"version": "2.0.0-alpha-2", | ||
"version": "2.0.0-alpha-3", | ||
"description": "A client-side API abstraction layer", | ||
@@ -5,0 +5,0 @@ "engines": { |
var singularize = require('./singularize') | ||
var url = require('./url') | ||
module.exports = function segmentize (segments) { | ||
return segments.map(function(segment, i) { | ||
return segment + (i === segments.length - 1 ? '' : '/{' + singularize(segment) + '_id}') | ||
}).reduce(url.resolve, '') | ||
}).join('/') | ||
} |
@@ -21,7 +21,2 @@ var parameterizeRoute = require('./parameterizeRoute') | ||
// Normalize the base url | ||
if (base.slice(-1) !== '/') { | ||
base += '/' | ||
} | ||
base = base.replace(trimRight, '') | ||
@@ -28,0 +23,0 @@ path = path.replace(trimLeft, '') |
@@ -36,3 +36,3 @@ var API = require('../src/api') | ||
var api = new API({ | ||
baseURL: 'http://example.com/api/' | ||
baseURL: 'http://example.com/api' | ||
}) | ||
@@ -39,0 +39,0 @@ var foo = api.namespace('foo') |
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
48298
863