Skip to content

Commit 5bc4145

Browse files
committed
Formatting, cleanup, fix referrer
1 parent c9f757f commit 5bc4145

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

src/Fetch/Core/Fetch/Headers.purs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ foreign import fromObject :: Object String -> Headers
3636
fromFoldable :: forall f. Foldable f => f (Tuple String String) -> Headers
3737
fromFoldable f = unsafePerformEffect do
3838
init <- unsafeNew
39-
foldM (\headers (Tuple key value) -> do
40-
runEffectFn3 unsafeAppend key value headers
41-
pure headers) init f
39+
foldM
40+
( \headers (Tuple key value) -> do
41+
runEffectFn3 unsafeAppend key value headers
42+
pure headers
43+
)
44+
init
45+
f
4246

4347
fromRecord :: forall r. Homogeneous r String => { | r } -> Headers
4448
fromRecord = unsafeFromRecord

src/Fetch/Core/Fetch/Integrity.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import Prelude (class Eq, class Ord)
55

66
newtype Integrity = Integrity String
77

8-
derive instance newtypeIntegrity :: Newtype Integrity _
9-
derive newtype instance eqIntegrity :: Eq Integrity
10-
derive newtype instance ordIntegrity :: Ord Integrity
8+
derive instance Newtype Integrity _
9+
derive newtype instance Eq Integrity
10+
derive newtype instance Ord Integrity

src/Fetch/Core/Fetch/Referrer.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ toString :: Referrer -> String
99
toString = case _ of
1010
ReferrerNone -> "none"
1111
ReferrerClient -> "client"
12-
ReferrerUrl url -> url
12+
ReferrerUrl url -> url
1313

1414
fromString :: String -> Referrer
1515
fromString = case _ of

src/Fetch/Core/Fetch/Request.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module Fetch.Core.Request
22
( Request
33
, RequestOptions
44
, UnsafeRequestOptions
5+
, _unsafeNew
56
, class ToInternal
67
, class ToInternalConverter
78
, class ToInternalHelper
@@ -15,9 +16,7 @@ module Fetch.Core.Request
1516
import Prelude
1617

1718
import Data.HTTP.Method (Method)
18-
import Data.Maybe (Maybe)
1919
import Data.Newtype (un)
20-
import Data.Nullable (Nullable)
2120
import Data.Symbol (class IsSymbol)
2221
import Effect (Effect)
2322
import Effect.Uncurried (EffectFn2, runEffectFn2)
@@ -51,7 +50,7 @@ type UnsafeRequestOptions =
5150
, credentials :: String
5251
, cache :: String
5352
, mode :: String
54-
, referrer :: Nullable String
53+
, referrer :: String
5554
, referrerPolicy :: String
5655
, integrity :: String
5756
)
@@ -63,7 +62,7 @@ type RequestOptions =
6362
, credentials :: RequestCredentials
6463
, cache :: RequestCache
6564
, mode :: RequestMode
66-
, referrer :: Maybe Referrer
65+
, referrer :: Referrer
6766
, referrerPolicy :: ReferrerPolicy
6867
, integrity :: Integrity
6968
)

src/Fetch/Core/Fetch/Response.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ module Fetch.Core.Response
1111
, statusText
1212
, text
1313
, url
14-
)
15-
where
14+
) where
1615

1716
import Data.ArrayBuffer.Types (ArrayBuffer, Uint8Array)
1817
import Effect (Effect)

0 commit comments

Comments
 (0)