node-web-i2c 1.1.15 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/index.ts +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.requestI2CAccess = exports.OperationError = exports.I2CPort = exports.I2
|
|
|
4
4
|
const i2c_bus_1 = require("i2c-bus");
|
|
5
5
|
const I2CPortMapSizeMax = 32;
|
|
6
6
|
const Uint16Max = 65535;
|
|
7
|
-
function parseUint16(
|
|
8
|
-
const n = Number.parseInt(
|
|
7
|
+
function parseUint16(parseString) {
|
|
8
|
+
const n = Number.parseInt(parseString, 10);
|
|
9
9
|
if (0 <= n && n <= Uint16Max)
|
|
10
10
|
return n;
|
|
11
11
|
else
|
package/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { openPromisified } from
|
|
1
|
+
import { openPromisified } from 'i2c-bus';
|
|
2
2
|
|
|
3
3
|
const I2CPortMapSizeMax = 32;
|
|
4
4
|
|
|
5
5
|
const Uint16Max = 65535;
|
|
6
6
|
|
|
7
|
-
function parseUint16(
|
|
8
|
-
const n = Number.parseInt(
|
|
7
|
+
function parseUint16(parseString: string) {
|
|
8
|
+
const n = Number.parseInt(parseString, 10);
|
|
9
9
|
if (0 <= n && n <= Uint16Max) return n;
|
|
10
10
|
else throw new RangeError(`Must be between 0 and ${Uint16Max}.`);
|
|
11
11
|
}
|