@yume-chan/adb-daemon-webusb
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -5,2 +5,8 @@ { | ||
{ | ||
"version": "0.0.24", | ||
"tag": "@yume-chan/adb-daemon-webusb_v0.0.24", | ||
"date": "Tue, 18 Jun 2024 02:49:43 GMT", | ||
"comments": {} | ||
}, | ||
{ | ||
"version": "0.0.23", | ||
@@ -7,0 +13,0 @@ "tag": "@yume-chan/adb-daemon-webusb_v0.0.23", |
# Change Log - @yume-chan/adb-daemon-webusb | ||
This log was last generated on Thu, 21 Mar 2024 03:15:10 GMT and should not be manually modified. | ||
This log was last generated on Tue, 18 Jun 2024 02:49:43 GMT and should not be manually modified. | ||
## 0.0.24 | ||
Tue, 18 Jun 2024 02:49:43 GMT | ||
_Version update only_ | ||
## 0.0.23 | ||
@@ -6,0 +11,0 @@ Thu, 21 Mar 2024 03:15:10 GMT |
import { AdbPacketHeader, AdbPacketSerializeStream, unreachable, } from "@yume-chan/adb"; | ||
import { ConsumableWritableStream, DuplexStreamFactory, ReadableStream, pipeFrom, } from "@yume-chan/stream-extra"; | ||
import { DuplexStreamFactory, MaybeConsumable, ReadableStream, pipeFrom, } from "@yume-chan/stream-extra"; | ||
import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct"; | ||
@@ -20,3 +20,3 @@ import { findUsbAlternateInterface, getSerialNumber, isErrorName, } from "./utils.js"; | ||
if (endpoints.length === 0) { | ||
throw new Error("No endpoints given"); | ||
throw new TypeError("No endpoints given"); | ||
} | ||
@@ -42,6 +42,6 @@ let inEndpoint; | ||
if (!inEndpoint) { | ||
throw new Error("No input endpoint found."); | ||
throw new TypeError("No input endpoint found."); | ||
} | ||
if (!outEndpoint) { | ||
throw new Error("No output endpoint found."); | ||
throw new TypeError("No output endpoint found."); | ||
} | ||
@@ -125,3 +125,3 @@ throw new Error("unreachable"); | ||
const zeroMask = outEndpoint.packetSize - 1; | ||
this.#writable = pipeFrom(duplex.createWritable(new ConsumableWritableStream({ | ||
this.#writable = pipeFrom(duplex.createWritable(new MaybeConsumable.WritableStream({ | ||
write: async (chunk) => { | ||
@@ -134,4 +134,3 @@ try { | ||
// so the OS will send it to the device immediately. | ||
if (zeroMask && | ||
(chunk.byteLength & zeroMask) === 0) { | ||
if (zeroMask && (chunk.length & zeroMask) === 0) { | ||
await device.raw.transferOut(outEndpoint.endpointNumber, EMPTY_UINT8_ARRAY); | ||
@@ -138,0 +137,0 @@ } |
@@ -22,3 +22,3 @@ export function isErrorName(e, name) { | ||
} | ||
throw new Error("No matched alternate interface found"); | ||
throw new TypeError("No matched alternate interface found"); | ||
} | ||
@@ -25,0 +25,0 @@ function padNumber(value) { |
{ | ||
"name": "@yume-chan/adb-daemon-webusb", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "Adb daemon transport connection for `@yume-chan/adb` using WebUSB API.", | ||
@@ -29,6 +29,5 @@ "keywords": [ | ||
"@types/w3c-web-usb": "^1.0.10", | ||
"@yume-chan/adb": "^0.0.23", | ||
"@yume-chan/stream-extra": "^0.0.23", | ||
"@yume-chan/struct": "^0.0.23", | ||
"tslib": "^2.6.2" | ||
"@yume-chan/adb": "^0.0.24", | ||
"@yume-chan/stream-extra": "^0.0.24", | ||
"@yume-chan/struct": "^0.0.24" | ||
}, | ||
@@ -38,5 +37,4 @@ "devDependencies": { | ||
"@yume-chan/tsconfig": "^1.0.0", | ||
"eslint": "^8.57.0", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.4.2" | ||
"prettier": "^3.3.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -46,4 +44,4 @@ "scripts": { | ||
"build:watch": "tsc -b tsconfig.build.json", | ||
"lint": "eslint src/**/*.ts --fix && prettier src/**/*.ts --write --tab-width 4" | ||
"lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4" | ||
} | ||
} |
@@ -17,4 +17,4 @@ import type { | ||
import { | ||
ConsumableWritableStream, | ||
DuplexStreamFactory, | ||
MaybeConsumable, | ||
ReadableStream, | ||
@@ -49,3 +49,3 @@ pipeFrom, | ||
if (endpoints.length === 0) { | ||
throw new Error("No endpoints given"); | ||
throw new TypeError("No endpoints given"); | ||
} | ||
@@ -74,6 +74,6 @@ | ||
if (!inEndpoint) { | ||
throw new Error("No input endpoint found."); | ||
throw new TypeError("No input endpoint found."); | ||
} | ||
if (!outEndpoint) { | ||
throw new Error("No output endpoint found."); | ||
throw new TypeError("No output endpoint found."); | ||
} | ||
@@ -194,3 +194,3 @@ throw new Error("unreachable"); | ||
duplex.createWritable( | ||
new ConsumableWritableStream({ | ||
new MaybeConsumable.WritableStream({ | ||
write: async (chunk) => { | ||
@@ -207,6 +207,3 @@ try { | ||
// so the OS will send it to the device immediately. | ||
if ( | ||
zeroMask && | ||
(chunk.byteLength & zeroMask) === 0 | ||
) { | ||
if (zeroMask && (chunk.length & zeroMask) === 0) { | ||
await device.raw.transferOut( | ||
@@ -213,0 +210,0 @@ outEndpoint.endpointNumber, |
@@ -45,3 +45,3 @@ export function isErrorName(e: unknown, name: string): boolean { | ||
throw new Error("No matched alternate interface found"); | ||
throw new TypeError("No matched alternate interface found"); | ||
} | ||
@@ -48,0 +48,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4
4
1274
98797
+ Added@yume-chan/adb@0.0.24(transitive)
+ Added@yume-chan/event@0.0.24(transitive)
+ Added@yume-chan/no-data-view@0.0.24(transitive)
+ Added@yume-chan/stream-extra@0.0.24(transitive)
+ Added@yume-chan/struct@0.0.24(transitive)
- Removedtslib@^2.6.2
- Removed@yume-chan/adb@0.0.23(transitive)
- Removed@yume-chan/dataview-bigint-polyfill@0.0.23(transitive)
- Removed@yume-chan/event@0.0.23(transitive)
- Removed@yume-chan/stream-extra@0.0.23(transitive)
- Removed@yume-chan/struct@0.0.23(transitive)
Updated@yume-chan/adb@^0.0.24
Updated@yume-chan/struct@^0.0.24