Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm update #34

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ module.exports = {
// disallow use of (old style) octal literals
'no-octal': 2,
// disallow reassignment of function parameters
'no-param-reassign': 2,
'no-param-reassign': 0,
// disallow use of process.env
'no-process-env': 2,
// disallow usage of __proto__ property
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/web-utils",
"version": "1.3.4",
"version": "1.4.0",
"description": "Picovoice web utility functions",
"author": "Picovoice",
"license": "Apache-2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
loadModel,
stringHeaderToObject,
open,
unsignedAddress,
} from './utils';

import { PvFile } from './pv_file';
Expand Down Expand Up @@ -61,6 +62,7 @@ export {
fromBase64,
fromPublicDirectory,
loadModel,
unsignedAddress,
// PvFile
open,
dbConfig,
Expand Down
12 changes: 12 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ import { PvFileIDB } from './pv_file_idb';
import { PvFileMem } from './pv_file_mem';
import { PvModel } from './types';

/**
* Cast a signed address to unsigned address.
*
* @param address The address to cast to unsigned address.
*/
export function unsignedAddress(address: number) {
if (address < 0) {
return address >>> 0;
}
return address;
}

/**
* Convert a null terminated phrase stored inside an array buffer to a string
*
Expand Down
Loading
Loading