Skip to content

chore: remove _ from code #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/fetch_examples.res
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let _ = {
}

let _ = {
Fetch.fetchWithInit("/api/hello", Fetch.RequestInit.make(~method_=Post, ()))
Fetch.fetchWithInit("/api/hello", Fetch.RequestInit.make(~method=Post, ()))
->then(Fetch.Response.text)
->then(text => print_endline(text)->resolve)
}
Expand All @@ -31,7 +31,7 @@ let _ = {
Fetch.fetchWithInit(
"/api/hello",
Fetch.RequestInit.make(
~method_=Post,
~method=Post,
~body=Fetch.BodyInit.make(Js.Json.stringify(Js.Json.object_(payload))),
~headers=Fetch.HeadersInit.make({"Content-Type": "application/json"}),
(),
Expand All @@ -51,7 +51,7 @@ let _ = {
Fetch.fetchWithInit(
"/api/upload",
Fetch.RequestInit.make(
~method_=Post,
~method=Post,
~body=Fetch.BodyInit.makeWithFormData(formData),
~headers=Fetch.HeadersInit.make({"Accept": "*"}),
(),
Expand Down
2 changes: 1 addition & 1 deletion src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Impl = (
@get external length: t_htmlFormElement => int = "length"
@get external name: t_htmlFormElement => string = "name"
@set external setName: (t_htmlFormElement, string) => unit = "name"
@get external method_: t_htmlFormElement => string = "method_"
@get external method: t_htmlFormElement => string = "method"
@set external setMethod: (t_htmlFormElement, string) => unit = "method"
@get external target: t_htmlFormElement => string = "target"
@set external setTarget: (t_htmlFormElement, string) => unit = "target"
Expand Down
8 changes: 4 additions & 4 deletions src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ module Impl = (

@send external setSelectionRange: (t_htmlInputElement, int, int) => unit = "setSelectionRange"
@send
external setSelectionRangeWithDirection_: (t_htmlInputElement, int, int, string) => unit =
external setSelectionRangeWithDirection: (t_htmlInputElement, int, int, string) => unit =
"setSelectionRange"
let setSelectionRangeWithDirection = (
selectionStart,
selectionEnd,
selectionDirection,
element,
) =>
element->setSelectionRangeWithDirection_(
element->setSelectionRangeWithDirection(
selectionStart,
selectionEnd,
selectionDirection->SelectionDirection.toString,
Expand Down Expand Up @@ -161,7 +161,7 @@ module Impl = (
external setRangeTextWithinInterval: (t_htmlInputElement, string, int, int) => unit =
"setRangeText"
@send
external setRangeTextWithinIntervalWithSelectionMode_: (
external setRangeTextWithinIntervalWithSelectionMode: (
t_htmlInputElement,
string,
int,
Expand All @@ -175,7 +175,7 @@ module Impl = (
selectionMode,
element,
) =>
element->setRangeTextWithinIntervalWithSelectionMode_(
element->setRangeTextWithinIntervalWithSelectionMode(
text,
selectionStart,
selectionEnd,
Expand Down
2 changes: 1 addition & 1 deletion src/Webapi/Webapi__Blob.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Impl = (

@get external size: T.t => float = "size"

@send external slice: (T.t, ~start: int=?, ~end_: int=?, ~contentType: string=?, unit) => T.t = "slice"
@send external slice: (T.t, ~start: int=?, ~end: int=?, ~contentType: string=?, unit) => T.t = "slice"

@send external stream: T.t => Webapi__ReadableStream.t = "stream"

Expand Down
12 changes: 6 additions & 6 deletions src/Webapi/Webapi__Fetch.res
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let encodeRequestMethod = x =>
| Options => "OPTIONS"
| Trace => "TRACE"
| Patch => "PATCH"
| Other(method_) => method_
| Other(method) => method
}
let decodeRequestMethod = x =>
/* internal */
Expand All @@ -62,7 +62,7 @@ let decodeRequestMethod = x =>
| "OPTIONS" => Options
| "TRACE" => Trace
| "PATCH" => Patch
| method_ => Other(method_)
| method => Other(method)
}

type referrerPolicy =
Expand Down Expand Up @@ -324,7 +324,7 @@ module RequestInit = {
unit,
) => requestInit = ""
let make = (
~method_: option<requestMethod>=?,
~method: option<requestMethod>=?,
~headers: option<headersInit>=?,
~body: option<bodyInit>=?,
~referrer: option<string>=?,
Expand All @@ -338,7 +338,7 @@ module RequestInit = {
~signal: option<signal>=?,
) =>
make(
~_method=?map(encodeRequestMethod, method_),
~_method=?map(encodeRequestMethod, method),
~headers?,
~body?,
~referrer?,
Expand All @@ -365,8 +365,8 @@ module Request = {
@new external makeWithRequest: t => t = "Request"
@new external makeWithRequestInit: (t, requestInit) => t = "Request"

@get external method_: t => string = "method"
let method_: t => requestMethod = self => decodeRequestMethod(method_(self))
@get external method: t => string = "method"
let method: t => requestMethod = self => decodeRequestMethod(method(self))
@get external url: t => string = "url"
@get external headers: t => headers = "headers"
@get external destination: t => string = "destination"
Expand Down
4 changes: 2 additions & 2 deletions src/Webapi/Webapi__Fetch.resi
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module RequestInit: {
type t = requestInit

let make: (
~method_: requestMethod=?,
~method: requestMethod=?,
~headers: headersInit=?,
~body: bodyInit=?,
~referrer: string=?,
Expand All @@ -166,7 +166,7 @@ module Request: {
@new external makeWithRequest: t => t = "Request"
@new external makeWithRequestInit: (t, requestInit) => t = "Request"

let method_: t => requestMethod
let method: t => requestMethod
@get external url: t => string = "url"
@get external headers: t => headers = "headers"
let destination: t => requestDestination
Expand Down