Skip to content

Commit

Permalink
Merge pull request #34 from Picovoice/wasm-update
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Mar 25, 2024
2 parents 179dd50 + e5136b2 commit 4a2a49f
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 79 deletions.
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

0 comments on commit 4a2a49f

Please sign in to comment.