-
Notifications
You must be signed in to change notification settings - Fork 2
Complete implementation of standard typed arrays #3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Fwiw, I got a hacky horrible inefficient version of "ArrayBuffer to BitArray" to work via the following
Obviously the correct version doesn't have so much unnecessary byte->string->byte conversion :) |
Indeed! :) Tbh, I have not yet made my mind whether it makes sense to construct a |
I actually have a use case! I have a settings object in my react app; it has a great number of boolean or near boolean enums. I want to store the user settings in a query param, so I load the settings into a bit array, and then turn that into base64 from that array buffer. This allows the settings to be shared or survive a page reload. To deserialize, I load the bas64 string back into array buffer, and then into the bitarray to reconstruct the settings. |
Uh oh!
There was an error while loading. Please reload this page.
Current code only partially implements standard features of typed arrays. This issue provides a place to track progress and view it all in one shot.
PRs welcome!
Constructor
new TypedArray()
new TypedArray(length)
new TypedArray(typedArray)
new TypedArray(object)
new TypedArray(buffer)
: see hereUnrelevant (= won't implement)
new TypedArray(buffer, byteOffset)
: see herenew TypedArray(buffer, byteOffset, length)
: see hereStatic properties
BYTES_PER_ELEMENT
name
get BitArray[@@species]
Static methods
from()
of()
Instance properties
buffer
byteLength
byteOffset
length
Instance methods
at()
: see here for discussioncopyWithin()
entries()
every()
fill()
filter()
find()
findIndex()
forEach()
includes()
indexOf()
join()
keys()
lastIndexOf()
map()
reduce()
reduceRight()
reverse()
set()
slice()
some()
sort()
subarray()
values()
toString()
: see here for note on implementation.[@@iterator]()
Irrelevant (= won't implement)
toLocaleString()
: there is no local variation to displaying 1s or 0s.The text was updated successfully, but these errors were encountered: