New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add additional parsers and tests #1524
base: arthur/parser-combinator
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## arthur/parser-combinator #1524 +/- ##
============================================================
- Coverage 76.54% 75.16% -1.38%
============================================================
Files 92 92
Lines 4950 5014 +64
Branches 922 936 +14
============================================================
- Hits 3789 3769 -20
- Misses 858 947 +89
+ Partials 303 298 -5
|
// Temporary buffers to convert numbers. | ||
const float32Array = new Float32Array(1); | ||
const uInt8Float32Array = new Uint8Array(float32Array.buffer); | ||
const float64Array = new Float64Array(1); | ||
const uInt8Float64Array = new Uint8Array(float64Array.buffer); | ||
|
||
// Check endianness. | ||
float32Array[0] = -1; // 0xBF800000 | ||
// Either it is [0, 0, 128, 191] or [191, 128, 0, 0]. It is not possible to | ||
// check this with `os.endianness()` because that is determined at compile time. | ||
const bigEndian = uInt8Float32Array[3] === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken from base Node buffer.js
Adds the following parsers:
Adds tests for these parsers: