mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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:
committed by
David Lechner
parent
924cfff539
commit
618f7840da
+3
-3
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user