Skip to content

Commit

Permalink
Shorten things
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Oct 25, 2021
1 parent 0a46dab commit 11cf80d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const ipv4 = {
preencode (state, m) {
state.end += 4
},
encode (state, m) {
encodeIPv4(state, m)
},
encode: encodeIPv4,
decode (state) {
if (state.end - state.start < 4) throw new Error('Out of bounds')
return (
Expand All @@ -45,9 +43,7 @@ const ipv6 = {
preencode (state, m) {
state.end += 16
},
encode (state, m) {
encodeIPv6(state, m)
},
encode: encodeIPv6,
decode (state) {
if (state.end - state.start < 16) throw new Error('Out of bounds')
return (
Expand Down

0 comments on commit 11cf80d

Please sign in to comment.