mirror of
https://github.com/chirimen-oh/node-web-i2c.git
synced 2025-01-18 16:08:06 +00:00
parseUint16 の引数名修正
This commit is contained in:
parent
4fb0e68c34
commit
6d0093eed4
1 changed files with 3 additions and 3 deletions
6
index.ts
6
index.ts
|
@ -1,11 +1,11 @@
|
||||||
import { openPromisified } from "i2c-bus";
|
import { openPromisified } from 'i2c-bus';
|
||||||
|
|
||||||
const I2CPortMapSizeMax = 32;
|
const I2CPortMapSizeMax = 32;
|
||||||
|
|
||||||
const Uint16Max = 65535;
|
const Uint16Max = 65535;
|
||||||
|
|
||||||
function parseUint16(string: string) {
|
function parseUint16(parseString: string) {
|
||||||
const n = Number.parseInt(string, 10);
|
const n = Number.parseInt(parseString, 10);
|
||||||
if (0 <= n && n <= Uint16Max) return n;
|
if (0 <= n && n <= Uint16Max) return n;
|
||||||
else throw new RangeError(`Must be between 0 and ${Uint16Max}.`);
|
else throw new RangeError(`Must be between 0 and ${Uint16Max}.`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue