File tree 9 files changed +206
-193
lines changed 9 files changed +206
-193
lines changed Original file line number Diff line number Diff line change 15
15
- uses : purescript-contrib/setup-purescript@main
16
16
with :
17
17
purescript : " unstable"
18
+ purs-tidy : " latest"
18
19
19
20
- uses : actions/setup-node@v2
20
21
with :
33
34
run : |
34
35
bower install
35
36
npm run-script test --if-present
37
+
38
+ - name : Check formatting
39
+ run : |
40
+ purs-tidy check src test
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ New features:
11
11
Bugfixes:
12
12
13
13
Other improvements:
14
+ - Format code with ` purs-tidy ` ; enforce in CI (#52 by @JordanMartinez )
14
15
15
16
## [ v8.0.0] ( https://github.com/purescript-node/purescript-node-buffer/releases/tag/v8.0.0 ) - 2022-04-27
16
17
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ foreign import readImpl :: String -> Offset -> ImmutableBuffer -> Number
73
73
readString :: Encoding -> Offset -> Offset -> ImmutableBuffer -> String
74
74
readString = readStringImpl <<< encodingToNode
75
75
76
- foreign import readStringImpl ::
77
- String -> Offset -> Offset -> ImmutableBuffer -> String
76
+ foreign import readStringImpl
77
+ :: String -> Offset -> Offset -> ImmutableBuffer -> String
78
78
79
79
-- | Reads the buffer as a string with the specified encoding.
80
80
toString :: Encoding -> ImmutableBuffer -> String
@@ -92,8 +92,8 @@ foreign import toArrayBuffer :: ImmutableBuffer -> ArrayBuffer
92
92
getAtOffset :: Offset -> ImmutableBuffer -> Maybe Octet
93
93
getAtOffset = getAtOffsetImpl Just Nothing
94
94
95
- foreign import getAtOffsetImpl ::
96
- (Octet -> Maybe Octet ) -> Maybe Octet -> Offset -> ImmutableBuffer -> Maybe Octet
95
+ foreign import getAtOffsetImpl
96
+ :: (Octet -> Maybe Octet ) -> Maybe Octet -> Offset -> ImmutableBuffer -> Maybe Octet
97
97
98
98
-- | Concatenates a list of buffers.
99
99
foreign import concat :: Array ImmutableBuffer -> ImmutableBuffer
Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ foreign import writeInternal :: forall buf m. String -> Number -> Offset -> buf
82
82
writeString :: forall buf m . Monad m => Encoding -> Offset -> Int -> String -> buf -> m Int
83
83
writeString = writeStringInternal <<< encodingToNode
84
84
85
- foreign import writeStringInternal ::
86
- forall buf m . String -> Offset -> Int -> String -> buf -> m Int
85
+ foreign import writeStringInternal
86
+ :: forall buf m . String -> Offset -> Int -> String -> buf -> m Int
87
87
88
88
toArray :: forall buf m . Monad m => buf -> m (Array Octet )
89
89
toArray = usingFromImmutable Immutable .toArray
Original file line number Diff line number Diff line change @@ -31,17 +31,17 @@ data BufferValueType
31
31
| DoubleBE
32
32
33
33
instance showBufferValueType :: Show BufferValueType where
34
- show UInt8 = " UInt8"
34
+ show UInt8 = " UInt8"
35
35
show UInt16LE = " UInt16LE"
36
36
show UInt16BE = " UInt16BE"
37
37
show UInt32LE = " UInt32LE"
38
38
show UInt32BE = " UInt32BE"
39
- show Int8 = " Int8"
40
- show Int16LE = " Int16LE"
41
- show Int16BE = " Int16BE"
42
- show Int32LE = " Int32LE"
43
- show Int32BE = " Int32BE"
44
- show FloatLE = " FloatLE"
45
- show FloatBE = " FloatBE"
39
+ show Int8 = " Int8"
40
+ show Int16LE = " Int16LE"
41
+ show Int16BE = " Int16BE"
42
+ show Int32LE = " Int32LE"
43
+ show Int32BE = " Int32BE"
44
+ show FloatLE = " FloatLE"
45
+ show FloatBE = " FloatBE"
46
46
show DoubleLE = " DoubleLE"
47
47
show DoubleBE = " DoubleBE"
Original file line number Diff line number Diff line change 1
1
module Node.Encoding
2
- ( Encoding (..)
2
+ ( Encoding (..)
3
3
, encodingToNode
4
4
, byteLength
5
5
) where
@@ -17,26 +17,26 @@ data Encoding
17
17
| Hex
18
18
19
19
instance showEncoding :: Show Encoding where
20
- show ASCII = " ASCII"
21
- show UTF8 = " UTF8"
20
+ show ASCII = " ASCII"
21
+ show UTF8 = " UTF8"
22
22
show UTF16LE = " UTF16LE"
23
- show UCS2 = " UCS2"
24
- show Base64 = " Base64"
25
- show Latin1 = " Latin1"
26
- show Binary = " Binary"
27
- show Hex = " Hex"
23
+ show UCS2 = " UCS2"
24
+ show Base64 = " Base64"
25
+ show Latin1 = " Latin1"
26
+ show Binary = " Binary"
27
+ show Hex = " Hex"
28
28
29
29
-- | Convert an `Encoding` to a `String` in the format expected by Node.js
30
30
-- | APIs.
31
31
encodingToNode :: Encoding -> String
32
- encodingToNode ASCII = " ascii"
33
- encodingToNode UTF8 = " utf8"
32
+ encodingToNode ASCII = " ascii"
33
+ encodingToNode UTF8 = " utf8"
34
34
encodingToNode UTF16LE = " utf16le"
35
- encodingToNode UCS2 = " ucs2"
36
- encodingToNode Base64 = " base64"
37
- encodingToNode Latin1 = " latin1"
38
- encodingToNode Binary = " binary"
39
- encodingToNode Hex = " hex"
35
+ encodingToNode UCS2 = " ucs2"
36
+ encodingToNode Base64 = " base64"
37
+ encodingToNode Latin1 = " latin1"
38
+ encodingToNode Binary = " binary"
39
+ encodingToNode Hex = " hex"
40
40
41
41
foreign import byteLengthImpl :: String -> String -> Int
42
42
You can’t perform that action at this time.
0 commit comments