Skip to content

feat(js): add typed array toArray - #70

Merged
spiral-ladder merged 1 commit into
mainfrom
bing/typed-array-to-array
Jul 31, 2026
Merged

feat(js): add typed array toArray#70
spiral-ladder merged 1 commit into
mainfrom
bing/typed-array-to-array

Conversation

@spiral-ladder

Copy link
Copy Markdown
Member

closes #69

Comment thread examples/js_dsl/mod.zig
}

/// Sum exactly four bytes copied from a Uint8Array into a Zig array.
pub fn uint8Array4Sum(data: Uint8Array) !Number {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this fn for? Did this get committed accidentally?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, it's just an example usage of toArray (like the rest of the fn in this file)

but honestly im not a fan of the entire examples/ dir to begin with but not sure of a better alternative at this time

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, sorry, my sloppy review. I didn't see that this was an example.

Comment thread src/js/typed_arrays.zig
/// Returns:
/// 1) `error.LengthMismatch` when the TypedArray length differs from
/// `len`, or
/// 2) `error.TypeMismatch` when its element type is wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note, best for a separate PR: it would be nice to define the error sets for consumer use and use explicit error sets in return types.

@spiral-ladder
spiral-ladder merged commit ab42ab0 into main Jul 31, 2026
5 checks passed
@spiral-ladder
spiral-ladder deleted the bing/typed-array-to-array branch July 31, 2026 15:44
nazarhussain pushed a commit that referenced this pull request Aug 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[4.0.0](zapi-v3.1.0...zapi-v4.0.0)
(2026-08-18)


### ⚠ BREAKING CHANGES

* isolate DSL class tags across addons
([#67](#67))
* manage external buffer lifetime
([#66](#66))
* require writable external buffer storage
([#58](#58))

### Features

* add owned typed arrays
([#68](#68))
([b92c2de](b92c2de))
* **js:** add exact u32 conversion
([#71](#71))
([d6b21e1](d6b21e1))
* **js:** add typed array toArray
([#70](#70))
([ab42ab0](ab42ab0))
* **js:** export module/namespace consts and enums
([#73](#73))
([76dc0db](76dc0db))


### Bug Fixes

* **dsl:** support class pointer arguments
([#50](#50))
([9dd2111](9dd2111))
* harden N-API boundary against JS-triggerable memory bugs
([#60](#60))
([fff76f3](fff76f3))
* isolate DSL class tags across addons
([#67](#67))
([3ab8c11](3ab8c11))
* manage external buffer lifetime
([#66](#66))
([d134a6a](d134a6a))
* **napi:** receive raw pointer out parameters
([#57](#57))
([fde4a9a](fde4a9a))
* remove redundant platform check from musl detection
([#64](#64))
([0d4829c](0d4829c))
* require writable external buffer storage
([#58](#58))
([8fd898f](8fd898f))
* restore registerDecls on Zig 0.16
([#59](#59))
([7f3af3e](7f3af3e))


### Code Refactoring

* **js:** unify env lifecycle refcounting
([#53](#53))
([d3d5056](d3d5056))


### Miscellaneous Chores

* define changelog sections for release-please
([#54](#54))
([1c5e7b4](1c5e7b4))
* update dev deps ([#74](#74))
([5121590](5121590))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

feature request: toArray

2 participants