always use * as for semver imports

The imported names are very short, so it is helpful to always include
semver.
This commit is contained in:
David Lechner
2023-04-24 17:38:53 -05:00
committed by David Lechner
parent 924cfff539
commit 618f7840da
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -8,7 +8,7 @@
import { firmwareVersion } from '@pybricks/firmware';
import { Task, buffers, eventChannel } from 'redux-saga';
import { lt, satisfies } from 'semver';
import * as semver from 'semver';
import {
call,
cancel,
@@ -229,7 +229,7 @@ function* handleBleConnectPybricks(): Generator {
// notify user if old firmware
if (
lt(
semver.lt(
pythonVersionToSemver(firmwareRevision),
pythonVersionToSemver(firmwareVersion),
)
@@ -346,7 +346,7 @@ function* handleBleConnectPybricks(): Generator {
);
// hub capabilities characteristic was introduced in Pybricks Profile v1.2.0
if (satisfies(softwareRevision, '^1.2.0')) {
if (semver.satisfies(softwareRevision, '^1.2.0')) {
const pybricksHubCapabilitiesChar = yield* call(() =>
pybricksService.getCharacteristic(
pybricksHubCapabilitiesCharacteristicUUID,
+3 -3
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2021-2022 The Pybricks Authors
// Copyright (c) 2021-2023 The Pybricks Authors
import { lt } from 'semver';
import * as semver from 'semver';
import { pythonVersionToSemver } from './version';
describe('pythonVersionToSemver', () => {
@@ -21,7 +21,7 @@ describe('pythonVersionToSemver', () => {
['v1.0.0c1', 'v1.0.0'],
])('%s < %s', (first, second) => {
expect(
lt(pythonVersionToSemver(first), pythonVersionToSemver(second)),
semver.lt(pythonVersionToSemver(first), pythonVersionToSemver(second)),
).toBeTruthy();
});