@picovoice/cobra-web-factory
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -19,6 +19,6 @@ /** | ||
* @param arrayBuffer input array buffer | ||
* @param index the index at which the phrase is stored | ||
* @param indexStart the index at which the phrase is stored | ||
* @return retrieved string | ||
*/ | ||
export declare function arrayBufferToStringAtIndex(arrayBuffer: Uint8Array, index: number): string; | ||
export declare function arrayBufferToStringAtIndex(arrayBuffer: Uint8Array, indexStart: number): string; | ||
/** | ||
@@ -25,0 +25,0 @@ * Decode a base64 string and stored it in a Uint8Array array |
{ | ||
"name": "@picovoice/cobra-web-factory", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Cobra library for web browsers (via WebAssembly)", | ||
@@ -56,4 +56,4 @@ "author": "Picovoice Inc", | ||
"dependencies": { | ||
"@picovoice/cobra-web-core": "^1.1.0" | ||
"@picovoice/cobra-web-core": "^1.0.0" | ||
} | ||
} |
@@ -105,16 +105,16 @@ /* | ||
* @param arrayBuffer input array buffer | ||
* @param index the index at which the phrase is stored | ||
* @param indexStart the index at which the phrase is stored | ||
* @return retrieved string | ||
*/ | ||
export function arrayBufferToStringAtIndex( | ||
export function arrayBufferToStringAtIndex( | ||
arrayBuffer: Uint8Array, | ||
index: number | ||
indexStart: number, | ||
): string { | ||
let stringBuffer = ''; | ||
let indexBuffer = index; | ||
while (arrayBuffer[indexBuffer] !== 0) { | ||
stringBuffer += String.fromCharCode(arrayBuffer[indexBuffer++]); | ||
let indexEnd = indexStart; | ||
while (arrayBuffer[indexEnd] !== 0) { | ||
indexEnd++; | ||
} | ||
return stringBuffer; | ||
const utf8decoder = new TextDecoder('utf-8'); | ||
return utf8decoder.decode(arrayBuffer.subarray(indexStart, indexEnd)); | ||
} | ||
@@ -121,0 +121,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1682541
4