Skip to content

Commit

Permalink
chore: rename internal fn on curly wrapper from curl to curly
Browse files Browse the repository at this point in the history
  • Loading branch information
JCMais committed May 20, 2019
1 parent 1b43e92 commit dfcdf37
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/curly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface CurlyFunction extends HttpMethodCalls {
}

const create = (): CurlyFunction => {
function curl(
function curly(
url: string,
options: CurlOptionValueType = {},
): Promise<CurlyResult> {
Expand Down Expand Up @@ -134,22 +134,22 @@ const create = (): CurlyFunction => {
})
}

curl.create = create
curly.create = create

for (const httpMethod of methods) {
// @ts-ignore
curl[httpMethod] =
curly[httpMethod] =
httpMethod === 'get'
? curl
? curly
: (url: string, options: CurlOptionValueType = {}) =>
curl(url, {
curly(url, {
customRequest: httpMethod,
...options,
})
}

// @ts-ignore
return curl
return curly
}

export const curly = create()

0 comments on commit dfcdf37

Please sign in to comment.