-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71d3f2a
commit d89be63
Showing
10 changed files
with
140 additions
and
140 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
packages/arcgis-rest-request/src/utils/with-request-options.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { IRequestOptions } from "./IRequestOptions"; | ||
|
||
export function withUrl<T1, T2 extends (...args: any[]) => any>( | ||
url: string, | ||
func: T2 | ||
): (o: Parameters<T2>[0]) => ReturnType<T2> { | ||
return (options: Parameters<T2>[0]): ReturnType<T2> => { | ||
return func({ | ||
...options, | ||
...{ url } | ||
}); | ||
export function withUrl<T extends (...args: any[]) => any>( | ||
func: T, | ||
url: string | ||
): (...funcArgs: Parameters<T>) => ReturnType<T> { | ||
return (...args: Parameters<T>): ReturnType<T> => { | ||
const options: IRequestOptions = | ||
typeof args[args.length - 1] === "object" | ||
? { | ||
...{ url }, | ||
...args.pop() | ||
} | ||
: { url }; | ||
|
||
return func(...[...args, options]); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters