Skip to content

Commit 2bd0404

Browse files
committed
Update comments / leverage type aliases
1 parent c722e4e commit 2bd0404

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/Dotenv/Internal/Parse.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Data.Array.NonEmpty (head, length, some) as NonEmpty
99
import Data.Array.NonEmpty (NonEmptyArray)
1010
import Data.String.CodeUnits (fromCharArray)
1111
import Data.Tuple (Tuple(..))
12-
import Dotenv.Internal.Types (Name, Settings, Value(..))
12+
import Dotenv.Internal.Types (Name, Setting, Settings, Value(..))
1313
import Text.Parsing.Parser (Parser)
1414
import Text.Parsing.Parser.Combinators ((<?>), lookAhead, notFollowedBy, skipMany, sepEndBy, try)
1515
import Text.Parsing.Parser.String (char, noneOf, oneOf, string, whiteSpace)
@@ -70,5 +70,5 @@ value :: Parser String Value
7070
value = (quotedValue '"' <|> quotedValue '\'' <|> unquotedValue) <?> "variable value"
7171

7272
-- | Parses a setting in the form of `NAME=value`.
73-
setting :: Parser String (Tuple String Value)
73+
setting :: Parser String Setting
7474
setting = Tuple <$> name <*> value

src/Dotenv/Internal/Resolve.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Data.String (joinWith)
1212
import Data.Traversable (sequence)
1313
import Data.Tuple (Tuple, fst, snd)
1414
import Dotenv.Internal.Types (Environment, Name, Settings, Value(..))
15+
import Dotenv.Types (Settings) as Public
1516
import Foreign.Object (lookup)
1617

1718
-- | Given the environment and an array of `.env` settings, resolves the specified value.
@@ -30,5 +31,5 @@ value env settings val =
3031
VariableSubstitution name -> lookup name env <|> (value' =<< snd <$> find (eq name <<< fst) settings)
3132

3233
-- | Given the environment and an array of `.env` settings, resolves the value of each setting.
33-
values :: Environment -> Settings -> Array (Tuple Name (Maybe String))
34+
values :: Environment -> Settings -> Public.Settings
3435
values env settings = rmap (value env settings) <$> settings

src/Dotenv/Internal/Types.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- | This module contains the data types representing parsed `.env` content.
1+
-- | This module contains data types representing parsed `.env` content and the unmodified environment.
22

33
module Dotenv.Internal.Types (Environment, Name, Setting, Settings, Value(..)) where
44

@@ -20,7 +20,7 @@ instance showValue :: Show Value where
2020
show (VariableSubstitution v) = "(VariableSubstitution \"" <> v <> "\")"
2121
show (ValueExpression vs) = "(ValueExpression " <> show vs <> ")"
2222

23-
-- | The conjunction of a setting name and value
23+
-- | The conjunction of a setting name and the corresponding value
2424
type Setting = Tuple Name Value
2525

2626
-- | A collection of settings

src/Dotenv/Types.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- | This module defines type aliases used in the base module.
1+
-- | This module defines type aliases representing `.env` settings.
22

33
module Dotenv.Types (Name, Setting, Settings, Value) where
44

0 commit comments

Comments
 (0)