compact-encoding 2.19.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -665,7 +665,21 @@ const any = (exports.any = {
|
|
|
665
665
|
}
|
|
666
666
|
})
|
|
667
667
|
|
|
668
|
-
const port = (exports.port =
|
|
668
|
+
const port = (exports.port = {
|
|
669
|
+
preencode(state, p) {
|
|
670
|
+
if (!p) throw new Error('Port must be >0 and <65536')
|
|
671
|
+
uint16.preencode(state, p)
|
|
672
|
+
},
|
|
673
|
+
encode(state, p) {
|
|
674
|
+
if (!p) throw new Error('Port must be >0 and <65536')
|
|
675
|
+
uint16.encode(state, p)
|
|
676
|
+
},
|
|
677
|
+
decode(state) {
|
|
678
|
+
const p = uint16.decode(state)
|
|
679
|
+
if (!p) throw new Error('Port must be >0 and <65536')
|
|
680
|
+
return p
|
|
681
|
+
}
|
|
682
|
+
})
|
|
669
683
|
|
|
670
684
|
const address = (host, family) => {
|
|
671
685
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compact-encoding",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.1",
|
|
4
4
|
"description": "A series of compact encoding schemes for building small and fast parsers and serializers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/holepunchto/compact-encoding.git"
|
|
21
21
|
},
|
|
22
22
|
"author": "Mathias Buus (@mafintosh)",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/
|
|
25
|
+
"url": "https://github.com/holepunchto/compact-encoding/issues"
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://github.com/
|
|
27
|
+
"homepage": "https://github.com/holepunchto/compact-encoding"
|
|
28
28
|
}
|