From f6b3404d5063c196601b82b423a671a4497d37aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=97=E8=BD=AC=E5=8F=8D=E4=BE=A7=E7=9A=84=E5=92=B8?= =?UTF-8?q?=E9=B1=BC?= <13435638964@163.com> Date: Sat, 11 Feb 2023 07:47:49 +0800 Subject: [PATCH] chore: remove _ from code --- examples/fetch_examples.res | 6 +++--- src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res | 2 +- src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res | 8 ++++---- src/Webapi/Webapi__Blob.res | 2 +- src/Webapi/Webapi__Fetch.res | 12 ++++++------ src/Webapi/Webapi__Fetch.resi | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/fetch_examples.res b/examples/fetch_examples.res index 04e76ab3..c31c42f5 100644 --- a/examples/fetch_examples.res +++ b/examples/fetch_examples.res @@ -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) } @@ -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"}), (), @@ -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": "*"}), (), diff --git a/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res b/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res index 48be0ed4..e3c3df5c 100644 --- a/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res +++ b/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res @@ -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" diff --git a/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res b/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res index abdedab1..f75dcf88 100644 --- a/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res +++ b/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res @@ -125,7 +125,7 @@ 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, @@ -133,7 +133,7 @@ module Impl = ( selectionDirection, element, ) => - element->setSelectionRangeWithDirection_( + element->setSelectionRangeWithDirection( selectionStart, selectionEnd, selectionDirection->SelectionDirection.toString, @@ -161,7 +161,7 @@ module Impl = ( external setRangeTextWithinInterval: (t_htmlInputElement, string, int, int) => unit = "setRangeText" @send - external setRangeTextWithinIntervalWithSelectionMode_: ( + external setRangeTextWithinIntervalWithSelectionMode: ( t_htmlInputElement, string, int, @@ -175,7 +175,7 @@ module Impl = ( selectionMode, element, ) => - element->setRangeTextWithinIntervalWithSelectionMode_( + element->setRangeTextWithinIntervalWithSelectionMode( text, selectionStart, selectionEnd, diff --git a/src/Webapi/Webapi__Blob.res b/src/Webapi/Webapi__Blob.res index 0f2d0ea1..9224d390 100644 --- a/src/Webapi/Webapi__Blob.res +++ b/src/Webapi/Webapi__Blob.res @@ -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" diff --git a/src/Webapi/Webapi__Fetch.res b/src/Webapi/Webapi__Fetch.res index c0933fb6..cac9ab93 100644 --- a/src/Webapi/Webapi__Fetch.res +++ b/src/Webapi/Webapi__Fetch.res @@ -47,7 +47,7 @@ let encodeRequestMethod = x => | Options => "OPTIONS" | Trace => "TRACE" | Patch => "PATCH" - | Other(method_) => method_ + | Other(method) => method } let decodeRequestMethod = x => /* internal */ @@ -62,7 +62,7 @@ let decodeRequestMethod = x => | "OPTIONS" => Options | "TRACE" => Trace | "PATCH" => Patch - | method_ => Other(method_) + | method => Other(method) } type referrerPolicy = @@ -324,7 +324,7 @@ module RequestInit = { unit, ) => requestInit = "" let make = ( - ~method_: option=?, + ~method: option=?, ~headers: option=?, ~body: option=?, ~referrer: option=?, @@ -338,7 +338,7 @@ module RequestInit = { ~signal: option=?, ) => make( - ~_method=?map(encodeRequestMethod, method_), + ~_method=?map(encodeRequestMethod, method), ~headers?, ~body?, ~referrer?, @@ -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" diff --git a/src/Webapi/Webapi__Fetch.resi b/src/Webapi/Webapi__Fetch.resi index 0a8ca18f..5a8ddb52 100644 --- a/src/Webapi/Webapi__Fetch.resi +++ b/src/Webapi/Webapi__Fetch.resi @@ -142,7 +142,7 @@ module RequestInit: { type t = requestInit let make: ( - ~method_: requestMethod=?, + ~method: requestMethod=?, ~headers: headersInit=?, ~body: bodyInit=?, ~referrer: string=?, @@ -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