diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-08-03 08:00:36 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-08-03 08:00:36 +0200 |
| commit | 2fdf04f54a2d4fe68068ebeb232624e3dcce24b7 (patch) | |
| tree | b234fa5537d59800c03573c002c105eb467b25ab /src | |
| parent | 3ed7dcd401e286d9e0b9ca5ea923f671699e7417 (diff) | |
| download | graphql-2fdf04f54a2d4fe68068ebeb232624e3dcce24b7.tar.gz | |
Remove leading carriage return in gql
Diffstat (limited to 'src')
| -rw-r--r-- | src/Language/GraphQL/TH.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Language/GraphQL/TH.hs b/src/Language/GraphQL/TH.hs index b6bc18c..8e1fcb3 100644 --- a/src/Language/GraphQL/TH.hs +++ b/src/Language/GraphQL/TH.hs @@ -21,7 +21,7 @@ stripIndentation code = reverse indent count (' ' : xs) = indent (count - 1) xs indent _ xs = xs withoutLeadingNewlines = dropNewlines code - dropNewlines = dropWhile (== '\n') + dropNewlines = dropWhile $ flip any ['\n', '\r'] . (==) spaces = length $ takeWhile (== ' ') withoutLeadingNewlines -- | Removes leading and trailing newlines. Indentation of the first line is |
