Skip to content

Commit e8fe84c

Browse files
Drop aliased encodings
1 parent a716d68 commit e8fe84c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ New features:
5656
- `INSPECT_MAX_BYTES`: https://nodejs.org/docs/latest-v18.x/api/buffer.html#bufferinspect_max_bytes
5757
- `MAX_LENGTH`: https://nodejs.org/docs/latest-v18.x/api/buffer.html#bufferconstantsmax_length
5858
- `MAX_STRING_LENGTH`: https://nodejs.org/docs/latest-v18.x/api/buffer.html#bufferconstantsmax_string_length
59-
- Added a new data constructor for `Encoding`: `Base64Url` (#56 by @JordanMartinez)
59+
- `Encoding`: Added/Removed data constructors (#56 by @JordanMartinez)
60+
61+
- Added: `Base64Url`
62+
- Removed aliases:
63+
- `Binary` - use `Latin1` instead
64+
- `UCS2` - use `UTF16LE` instead
6065

6166
Bugfixes:
6267

src/Node/Encoding.purs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,18 @@ data Encoding
1212
= ASCII
1313
| UTF8
1414
| UTF16LE
15-
| UCS2
1615
| Base64
1716
| Base64Url
1817
| Latin1
19-
| Binary
2018
| Hex
2119

2220
instance showEncoding :: Show Encoding where
2321
show ASCII = "ASCII"
2422
show UTF8 = "UTF8"
2523
show UTF16LE = "UTF16LE"
26-
show UCS2 = "UCS2"
2724
show Base64 = "Base64"
2825
show Base64Url = "Base64Url"
2926
show Latin1 = "Latin1"
30-
show Binary = "Binary"
3127
show Hex = "Hex"
3228

3329
-- | Convert an `Encoding` to a `String` in the format expected by Node.js
@@ -36,11 +32,9 @@ encodingToNode :: Encoding -> String
3632
encodingToNode ASCII = "ascii"
3733
encodingToNode UTF8 = "utf8"
3834
encodingToNode UTF16LE = "utf16le"
39-
encodingToNode UCS2 = "ucs2"
4035
encodingToNode Base64 = "base64"
4136
encodingToNode Base64Url = "base64url"
4237
encodingToNode Latin1 = "latin1"
43-
encodingToNode Binary = "binary"
4438
encodingToNode Hex = "hex"
4539

4640
foreign import byteLengthImpl :: Fn2 String String Int

0 commit comments

Comments
 (0)