Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@todesktop/client-util

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@todesktop/client-util - npm Package Compare versions

Comparing version 1.0.0-alpha11 to 1.0.0-alpha12

checkIfCompatibleWithPlugin.d.ts

44

checkIfCompatibleWithBackend.js

@@ -1,13 +0,3 @@

const getBackendVersion = () => typeof window["todesktop"] === "object" &&
window["todesktop"].desktopifyVersion;
import { isSemverGreaterOrEqualThan } from "./isSemverGreaterOrEqualThan";
/**
* Parses a simple semver string into a semver object.
* Works with "x.x.x" strings. Does not work with or "x.x.x-x" strings.
* @internal
*/
function parseSimpleSemVer(version) {
const [major, minor, patch] = version.split(".").map(Number);
return { major, minor, patch };
}
/**
* Checks if a desktopify api version is compatible with the current version of the desktopify backend

@@ -24,31 +14,3 @@ * @internal

}
/**
* Checks if a semver is greater or equal than another semver.
* Works with "x.x.x" strings. Does not work with or "x.x.x-x" strings.
* @internal
*/
function isSemverGreaterOrEqualThan(currentVersion, versionFeatureIntroduced) {
const curr = parseSimpleSemVer(currentVersion);
const introduced = parseSimpleSemVer(versionFeatureIntroduced);
if (curr.major > introduced.major) {
return true;
}
else if (curr.major < introduced.major) {
return false;
}
else if (curr.minor > introduced.minor) {
return true;
}
else if (curr.minor < introduced.minor) {
return false;
}
else if (curr.patch > introduced.patch) {
return true;
}
else if (curr.patch < introduced.patch) {
return false;
}
else {
return true;
}
}
const getBackendVersion = () => typeof window["todesktop"] === "object" &&
window["todesktop"].desktopifyVersion;

@@ -31,2 +31,3 @@ /**

BrowserView: BrowserView;
process: NodeJS.Process;
}

@@ -180,1 +181,2 @@ export interface NamespacesStaticV1 {

export { checkIfCompatibleWithBackend } from "./checkIfCompatibleWithBackend.js";
export { checkIfCompatibleWithPlugin } from "./checkIfCompatibleWithPlugin.js";

@@ -64,1 +64,2 @@ /**

export { checkIfCompatibleWithBackend } from "./checkIfCompatibleWithBackend.js";
export { checkIfCompatibleWithPlugin } from "./checkIfCompatibleWithPlugin.js";
{
"name": "@todesktop/client-util",
"version": "1.0.0-alpha11",
"version": "1.0.0-alpha12",
"description": "Utility functions for ToDesktop client libraries",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc