Skip to content

Commit a89a102

Browse files
authored
Merge pull request #1012 from google/js-deps
Update JS dependencies to prep for model 3.2
2 parents 68799c5 + 54792f6 commit a89a102

File tree

5 files changed

+2003
-1762
lines changed

5 files changed

+2003
-1762
lines changed

js/magika_node.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ export class MagikaNode extends Magika {
106106
const halfpoint = Math.max(0, Math.round(length / 2) - Math.round(this.config.midBytes / 2));
107107
const halfpointCap = Math.min(length, (halfpoint + this.config.midBytes));
108108
let lastChunk: Buffer | null = null;
109-
stream.on('data', (data: Buffer) => {
109+
stream.on('data', (data: string| Buffer) => {
110+
if (typeof data === 'string') {
111+
throw new Error('Stream data should be a Buffer, not a string');
112+
}
113+
110114
if ((stream.bytesRead - data.length) == 0) {
111115
features.withStart(data.slice(0, this.config.begBytes), 0);
112116
}

js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
"magika-js": "./dist/cjs/index.js"
3535
},
3636
"dependencies": {
37-
"@tensorflow/tfjs": "^4.19.0"
37+
"@tensorflow/tfjs": "^4.22.0"
3838
},
3939
"optionalDependencies": {
40-
"@tensorflow/tfjs-node": "^4.19.0",
40+
"@tensorflow/tfjs-node": "^4.22.0",
4141
"chalk": "^5.3.0",
4242
"commander": "^12.0.0"
4343
},

0 commit comments

Comments
 (0)