-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) · 818 Bytes
/
index.js
File metadata and controls
27 lines (22 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function factory(What){
return function(){
return new What(...arguments);
}
}
const { compileDecoder, compileEncoder } = require('./Compiler');
module.exports = {
Uint8: factory(require('./types/Uint8')),
Uint16: factory(require('./types/Uint16')),
Int16: factory(require('./types/Int16')),
Uint32: factory(require('./types/Uint32')),
Int32: factory(require('./types/Int32')),
Varint: factory(require('./types/Varint')),
Structure: factory(require('./types/Structure')),
Array: factory(require('./types/Array')),
OneOf: factory(require('./types/OneOf')),
Data: factory(require('./types/Data')),
String: factory(require('./types/advanced/String')),
Constant: factory(require('./types/advanced/Constant')),
Optional: factory(require('./types/advanced/Optional')),
compileEncoder, compileDecoder
};