From 68c8bc9afd773fddb7b408af45069599137e3708 Mon Sep 17 00:00:00 2001 From: Blake Doss Date: Wed, 16 Sep 2015 14:21:01 -0400 Subject: [PATCH] Fixed incorrect return type for segment method. --- urijs/URIjs-tests.ts | 4 ++++ urijs/URIjs.d.ts | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/urijs/URIjs-tests.ts b/urijs/URIjs-tests.ts index 2dfd15618..3501a6efc 100644 --- a/urijs/URIjs-tests.ts +++ b/urijs/URIjs-tests.ts @@ -34,3 +34,7 @@ URI('').setSearch('foo', 'bar'); URI('').setSearch({ foo: 'bar' }); var uri: uri.URI = $('a').uri(); + +URI('http://example.org/foo/hello.html').segment('bar'); +URI('http://example.org/foo/hello.html').segment(0, 'bar'); +URI('http://example.org/foo/hello.html').segment(['foo', 'bar', 'foobar.html']); \ No newline at end of file diff --git a/urijs/URIjs.d.ts b/urijs/URIjs.d.ts index 7bab32074..a41e06cbf 100644 --- a/urijs/URIjs.d.ts +++ b/urijs/URIjs.d.ts @@ -95,10 +95,10 @@ declare module uri { search(qry: boolean): any; search(qry: Object): URI; segment(): string[]; - segment(segments: string[]): string; + segment(segments: string[]): URI; segment(position: number): string; - segment(position: number, level: string): string; - segment(level: string): string; + segment(position: number, level: string): URI; + segment(segment: string): URI; setQuery(key: string, value: string): URI; setQuery(qry: Object): URI; setSearch(key: string, value: string): URI;