Skip to content

Commit

Permalink
Release k8-1.2 (r137)
Browse files Browse the repository at this point in the history
  • Loading branch information
attractivechaos committed May 27, 2024
1 parent 22cb705 commit fa626ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
13 changes: 7 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
Release 1.2-r135 (27 May 2024)
Release 1.2-r137 (27 May 2024)
------------------------------

New functions:

* `read_file()`: read an entire file as an ArrayBuffer
* `decode()`: convert an ArrayBuffer/Bytes object to a string
* `encode()`: convert a string to an ArrayBuffer
* `k8_read_file()`: read an entire file as an ArrayBuffer
* `k8_decode()`: convert an ArrayBuffer/Bytes object to a string
* `k8_encode()`: convert a string to an ArrayBuffer
* `k8_revcomp()`: reverse complement a DNA sequence

Improved:

* `Bytes.read()`: more flexible API to read the rest of a file
* `Bytes.read()`: allow to read the rest of a file

(1.2: 27 May 2024, r135)
(1.2: 27 May 2024, r137)



Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ function exit(code: number)
function load(fileName: string)

// Read entire file as an ArrayBuffer
function read_file(fileName: string): ArrayBuffer
function k8_read_file(fileName: string): ArrayBuffer

// Decode $buf to string under the $enc encoding; only "utf-8" is supported for now
// Missing or unknown encoding is treated as Latin-1
function decode(buf: ArrayBuffer|Bytes, enc?: string): string
function k8_decode(buf: ArrayBuffer|Bytes, enc?: string): string

// Encode $str into an ArrayBuffer
function encode(str: string, enc?: string): ArrayBuffer
function k8_encode(str: string, enc?: string): ArrayBuffer

// Reverse complement a DNA sequence in string
function revcomp(seq: string): string
function k8_revcomp(seq: string): string

// Reverse complement a DNA sequence in place
function revcomp(seq: ArrayBuffer|Bytes)
function k8_revcomp(seq: ArrayBuffer|Bytes)

// Get version string
function k8_version()
Expand Down
10 changes: 5 additions & 5 deletions k8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#define K8_VERSION "1.1-r136-dirty"
#define K8_VERSION "1.2-r137"

#include <stdlib.h>
#include <stdint.h>
Expand Down Expand Up @@ -911,10 +911,10 @@ static v8::Local<v8::Context> k8_create_shell_context(v8::Isolate* isolate)
global->Set(isolate, "warn", v8::FunctionTemplate::New(isolate, k8_warn));
global->Set(isolate, "exit", v8::FunctionTemplate::New(isolate, k8_exit));
global->Set(isolate, "load", v8::FunctionTemplate::New(isolate, k8_load));
global->Set(isolate, "read_file", v8::FunctionTemplate::New(isolate, k8_read_file));
global->Set(isolate, "encode", v8::FunctionTemplate::New(isolate, k8_encode));
global->Set(isolate, "decode", v8::FunctionTemplate::New(isolate, k8_decode));
global->Set(isolate, "revcomp", v8::FunctionTemplate::New(isolate, k8_revcomp));
global->Set(isolate, "k8_read_file", v8::FunctionTemplate::New(isolate, k8_read_file));
global->Set(isolate, "k8_encode", v8::FunctionTemplate::New(isolate, k8_encode));
global->Set(isolate, "k8_decode", v8::FunctionTemplate::New(isolate, k8_decode));
global->Set(isolate, "k8_revcomp", v8::FunctionTemplate::New(isolate, k8_revcomp));
global->Set(isolate, "k8_version", v8::FunctionTemplate::New(isolate, k8_version));
{ // add the 'Bytes' object
v8::HandleScope scope(isolate);
Expand Down

0 comments on commit fa626ad

Please sign in to comment.