-
Notifications
You must be signed in to change notification settings - Fork 475
Open
Description
Hey, awesome lib,
Why is it not possible to append multiple segments tho ? Maybe there's a logic behind that or I missed something.
const API_BASE_URL = new URI('https://api-staging.foo.fr/v1/foo')
const customUrl = API_BASE_URL()
.clone()
.segment([ 'name', 'customer', 'whatever' ]) // <- it replaces existing `v1/foo` path :(
.toString() // => https://api-staging.foo.fr/name/customer/whatever
// actual not so elegant solution
const customUrl = API_BASE_URL()
.clone()
.segment('name')
.segment('customer')
.segment('whatever') // <- I dont find it really relevant
.toString() // => https://api-staging.foo.fr/v1/foo/name/customer/whatever
// proposal
const customUrl = API_BASE_URL()
.clone()
.appendSegment([ 'name', 'customer', 'whatever' ])
.toString() // => https://api-staging.foo.fr/v1/foo/name/customer/whatever
kashev and yang-shu-cw
Metadata
Metadata
Assignees
Labels
No labels