Giter VIP home page Giter VIP logo

bit-typedarray's People

Contributors

dependabot[bot] avatar swiing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bit-typedarray's Issues

Complete implementation of standard typed arrays

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 here

Unrelevant (= won't implement)

  • new TypedArray(buffer, byteOffset): see here
  • new TypedArray(buffer, byteOffset, length): see here

Static properties

  • BYTES_PER_ELEMENT
  • name
  • get BitArray[@@species]

Static methods

  • from()
  • of()

Instance properties

  • buffer
  • byteLength
  • byteOffset
  • length

Instance methods

  • at(): see here for discussion
  • copyWithin()
  • 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.

construct from buffer

Typed array constructors can take an ArrayBuffer instance as single argument. E.g.:

let buffer = new ArrayBuffer(12);
new Uint32Array(buffer);

The length of the typed array is the length of the buffer, divided by the TypedArray.BYTES_PER_ELEMENT.

If applied to BitArrays, that would imply the length of BitArrays can only be multiple of 8. However, there is no reason that length of bit arrays should be so. Hence, I have written:

I have not yet made my mind whether it makes sense to construct a BitArray by passing an array buffer to the constructor.

This issue is created to open the discussion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.