as-pect / visitor-as

Visitor utilities for AssemblyScript compiler transforms
Apache License 2.0
37 stars 11 forks source link

feat: added includeBytes() function call replacement. includeBytes() -> StaticArray<u8> #6

Closed luciotato closed 4 years ago

luciotato commented 4 years ago

https://github.com/near/near-sdk-as/issues/214

Description Add includeBytes function in AssemblyScript, similar to Rust's include_bytes, which during compilation reads the contents of a file and places it into the data section of the binary.

Context AssemblyScript recently added a StaticArray, which is similar to arrays in C, which includes the length and continuous bytes.

API declare function includeBytes(path: string): StaticArray<u8>;